@@ -1,13 +1,11 @@ | |||||
<?php | <?php | ||||
/** | /** | ||||
* | |||||
* @version $Id: actionsearch_class.php 1 8:26 2010年7月12日Z tianya $ | * @version $Id: actionsearch_class.php 1 8:26 2010年7月12日Z tianya $ | ||||
* @package DedeBIZ.Administrator | * @package DedeBIZ.Administrator | ||||
* @copyright Copyright (c) 2022, DedeBIZ.COM | * @copyright Copyright (c) 2022, DedeBIZ.COM | ||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
class ActionSearch | class ActionSearch | ||||
{ | { | ||||
var $keyword; | var $keyword; | ||||
@@ -49,7 +47,7 @@ class ActionSearch | |||||
if (is_array($this->asarray[$key]['soniterm'])) { | if (is_array($this->asarray[$key]['soniterm'])) { | ||||
foreach ($this->asarray[$key]['soniterm'] as $k => $val) { | foreach ($this->asarray[$key]['soniterm'] as $k => $val) { | ||||
//进行权限判断 | //进行权限判断 | ||||
if (UserLogin::TestPurview($val['purview'])) { | |||||
if (TestPurview($val['purview'])) { | |||||
//如果有操作权限 | //如果有操作权限 | ||||
if ($this->_strpos($val['title'], $this->keyword) !== false || $this->_strpos($val['description'], $this->keyword) !== false) { | if ($this->_strpos($val['title'], $this->keyword) !== false || $this->_strpos($val['description'], $this->keyword) !== false) { | ||||
//一级项目匹配 | //一级项目匹配 | ||||
@@ -77,7 +75,7 @@ class ActionSearch | |||||
if (is_array($text)) { | if (is_array($text)) { | ||||
foreach ($text as $key => $value) { | foreach ($text as $key => $value) { | ||||
if ($key == 'title' || $key == 'description') { | if ($key == 'title' || $key == 'description') { | ||||
//仅对title,description进行数组替换 | |||||
//仅对title,description进行数组替换 | |||||
$text[$key] = str_replace($this->keyword, '<span class="text-danger">'.$this->keyword.'</span>', $text[$key]); | $text[$key] = str_replace($this->keyword, '<span class="text-danger">'.$this->keyword.'</span>', $text[$key]); | ||||
} | } | ||||
} | } | ||||
@@ -8,16 +8,17 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
require(dirname(__FILE__)."/config.php"); | require(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('plus_广告管理'); | |||||
CheckPurview('plus_广告管理'); | |||||
require_once DEDEINC."/typelink/typelink.class.php"; | |||||
if (empty($dopost)) $dopost = ""; | if (empty($dopost)) $dopost = ""; | ||||
if ($dopost == "save") { | if ($dopost == "save") { | ||||
CheckCSRF(); | CheckCSRF(); | ||||
//timeset tagname typeid normbody expbody | |||||
$tagname = trim($tagname); | $tagname = trim($tagname); | ||||
$row = $dsql->GetOne("SELECT typeid FROM `#@__myad` WHERE typeid='$typeid' AND tagname LIKE '$tagname'"); | $row = $dsql->GetOne("SELECT typeid FROM `#@__myad` WHERE typeid='$typeid' AND tagname LIKE '$tagname'"); | ||||
if (is_array($row)) { | if (is_array($row)) { | ||||
ShowMsg(Lang("mytag_add_err_same"), "-1"); | |||||
ShowMsg("在相同栏目下已经存在同名的标记", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$starttime = GetMkTime($starttime); | $starttime = GetMkTime($starttime); | ||||
@@ -52,10 +53,9 @@ if ($dopost == "save") { | |||||
} | } | ||||
$normbody = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.Macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\"$width $height><param name=\"movie\" value=\"{$link}\"/><param name=\"quality\" value=\"high\"/></object>"; | $normbody = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.Macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0\"$width $height><param name=\"movie\" value=\"{$link}\"/><param name=\"quality\" value=\"high\"/></object>"; | ||||
} | } | ||||
$query = "INSERT INTO #@__myad(clsid,typeid,tagname,adname,timeset,starttime,endtime,normbody,expbody) | |||||
VALUES ('$clsid','$typeid','$tagname','$adname','$timeset','$starttime','$endtime','$normbody','$expbody');"; | |||||
$query = "INSERT INTO `#@__myad` (clsid,typeid,tagname,adname,timeset,starttime,endtime,normbody,expbody) VALUES ('$clsid','$typeid','$tagname','$adname','$timeset','$starttime','$endtime','$normbody','$expbody');"; | |||||
$dsql->ExecuteNoneQuery($query); | $dsql->ExecuteNoneQuery($query); | ||||
ShowMsg(Lang("ad_success_add"), "ad_main.php"); | |||||
ShowMsg("成功增加一个广告", "ad_main.php"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$dsql->Execute('dd', 'SELECT * FROM `#@__myadtype` ORDER BY id DESC'); | $dsql->Execute('dd', 'SELECT * FROM `#@__myadtype` ORDER BY id DESC'); | ||||
@@ -8,29 +8,37 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DedeWin; | |||||
use DedeBIZ\Login\UserLogin; | |||||
require(dirname(__FILE__)."/config.php"); | require(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('plus_广告管理'); | |||||
CheckPurview('plus_广告管理'); | |||||
require_once(DEDEINC.'/typelink/typelink.class.php'); | |||||
if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
$aid = preg_replace("#[^0-9]#", '', $aid); | $aid = preg_replace("#[^0-9]#", '', $aid); | ||||
$ENV_GOBACK_URL = empty($_COOKIE['ENV_GOBACK_URL']) ? "ad_main.php" : $_COOKIE['ENV_GOBACK_URL']; | $ENV_GOBACK_URL = empty($_COOKIE['ENV_GOBACK_URL']) ? "ad_main.php" : $_COOKIE['ENV_GOBACK_URL']; | ||||
if ($dopost == 'delete') { | if ($dopost == 'delete') { | ||||
$dsql->ExecuteNoneQuery("DELETE FROM `#@__myad` WHERE aid='$aid'"); | |||||
ShowMsg(Lang("ad_success_delete"), $ENV_GOBACK_URL); | |||||
$dsql->ExecuteNoneQuery("DELETE FROM `#@__myad` WHERE aid='$aid' "); | |||||
ShowMsg("成功删除一则广告代码", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} else if ($dopost == "gettag") { | } else if ($dopost == "gettag") { | ||||
require_once(DEDEINC.'/libraries/oxwindow.class.php'); | |||||
$jscode = "<script src='{$cfg_phpurl}/ad_js.php?aid=$aid'></script>"; | $jscode = "<script src='{$cfg_phpurl}/ad_js.php?aid=$aid'></script>"; | ||||
$showhtml = "<xmp style='color:#333333;background-color:#ffffff'>\r\n\r\n$jscode\r\n\r\n</xmp>"; | $showhtml = "<xmp style='color:#333333;background-color:#ffffff'>\r\n\r\n$jscode\r\n\r\n</xmp>"; | ||||
$showhtml .= Lang('view').":<iframe name='testfrm' frameborder='0' src='ad_edit.php?aid={$aid}&dopost=testjs' id='testfrm' width='100%' height='200'></iframe>"; | |||||
$row = $dsql->GetOne("SELECT tagname FROM `#@__myad` WHERE aid='$aid'"); | |||||
$showhtml .= "预览:<iframe name='testfrm' frameborder='0' src='ad_edit.php?aid={$aid}&dopost=testjs' id='testfrm' width='100%' height='200'></iframe>"; | |||||
$row = $dsql->GetOne("SELECT tagname from `#@__myad` WHERE aid='$aid' "); | |||||
$showtag = '{'."dede:myad name='{$row['tagname']}'/".'}'; | $showtag = '{'."dede:myad name='{$row['tagname']}'/".'}'; | ||||
$info = Lang("ad_info"); | |||||
$wintitle = Lang("ad_title"); | |||||
$wecome_info = "<a href='ad_main.php'>".Lang('ad_main')."</a>::".Lang('ad_main_getjs'); | |||||
DedeWin::Instance()->Init()->GetWindow("hand", $info)->AddTitle(Lang("ad_edit_title1")) | |||||
->GetWindow("hand", $showtag)->SetMyWinItem("") | |||||
->AddTitle(Lang("ad_edit_title2"))->GetWindow("hand", $showhtml)->Display(); | |||||
$info = "说明:如果嵌入的是织梦CMS广告标签,那将会解析成标签中的内容到页面,广告修改后需要重新生成<br> | |||||
如果不希望重新生成所有页面,则直接调用JS代码即可 | |||||
"; | |||||
$wintitle = "广告管理-获取广告标签"; | |||||
$wecome_info = "<a href='ad_main.php'>广告管理</a>::获取JS"; | |||||
$win = new OxWindow(); | |||||
$win->Init(); | |||||
$winform = $win->GetWindow("hand", $info); | |||||
$win->AddTitle("织梦CMS标签调用代码:"); | |||||
$winform = $win->GetWindow("hand", $showtag); | |||||
$win->myWinItem = ''; | |||||
$win->AddTitle("以下为选定广告的js调用代码:"); | |||||
$winform = $win->GetWindow("hand", $showhtml); | |||||
$win->Display(); | |||||
exit(); | exit(); | ||||
} else if ($dopost == 'testjs') { | } else if ($dopost == 'testjs') { | ||||
echo "<script src='{$cfg_phpurl}/ad_js.php?aid=$aid&nocache=1'></script>"; | echo "<script src='{$cfg_phpurl}/ad_js.php?aid=$aid&nocache=1'></script>"; | ||||
@@ -41,7 +49,7 @@ if ($dopost == 'delete') { | |||||
$endtime = GetMkTime($endtime); | $endtime = GetMkTime($endtime); | ||||
$query = "UPDATE `#@__myad` SET clsid='$clsid',typeid='$typeid',adname='$adname',timeset='$timeset',starttime='$starttime',endtime='$endtime',normbody='$normbody',expbody='$expbody' WHERE aid='$aid'"; | $query = "UPDATE `#@__myad` SET clsid='$clsid',typeid='$typeid',adname='$adname',timeset='$timeset',starttime='$starttime',endtime='$endtime',normbody='$normbody',expbody='$expbody' WHERE aid='$aid'"; | ||||
$dsql->ExecuteNoneQuery($query); | $dsql->ExecuteNoneQuery($query); | ||||
ShowMsg(Lang("ad_success_edit"), $ENV_GOBACK_URL); | |||||
ShowMsg("成功修改一则广告代码", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} | } | ||||
$row = $dsql->GetOne("SELECT * FROM `#@__myad` WHERE aid='$aid'"); | $row = $dsql->GetOne("SELECT * FROM `#@__myad` WHERE aid='$aid'"); | ||||
@@ -8,11 +8,9 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DataListCP; | |||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__).'/config.php'); | require_once(dirname(__FILE__).'/config.php'); | ||||
require_once(DEDEINC.'/datalistcp.class.php'); | |||||
require_once(DEDEINC.'/common.func.php'); | require_once(DEDEINC.'/common.func.php'); | ||||
UserLogin::CheckPurview('plus_广告管理'); | |||||
setcookie('ENV_GOBACK_URL', $dedeNowurl, time() + 3600, '/'); | setcookie('ENV_GOBACK_URL', $dedeNowurl, time() + 3600, '/'); | ||||
$clsid = isset($clsid) ? intval($clsid) : 0; | $clsid = isset($clsid) ? intval($clsid) : 0; | ||||
$keyword = isset($keyword) ? addslashes($keyword) : ''; | $keyword = isset($keyword) ? addslashes($keyword) : ''; | ||||
@@ -28,7 +26,7 @@ while ($arr = $dsql->GetArray('dd')) { | |||||
$where_sql = ' 1=1'; | $where_sql = ' 1=1'; | ||||
if ($clsid != 0) $where_sql .= " AND clsid = $clsid"; | if ($clsid != 0) $where_sql .= " AND clsid = $clsid"; | ||||
if ($keyword != '') $where_sql .= " AND (ad.adname like '%$keyword%') "; | if ($keyword != '') $where_sql .= " AND (ad.adname like '%$keyword%') "; | ||||
$sql = "SELECT ad.aid,ad.clsid,ad.tagname,tp.typename as typename,ad.adname,ad.timeset,ad.endtime,ap.typename as clsname FROM `#@__myad` ad LEFT JOIN `#@__arctype` tp on tp.id=ad.typeid LEFT JOIN `#@__myadtype` ap on ap.id=ad.clsid WHERE $where_sql ORDER BY ad.aid DESC"; | |||||
$sql = "SELECT ad.aid,ad.clsid,ad.tagname,tp.typename as typename,ad.adname,ad.timeset,ad.endtime,ap.typename as clsname FROM `#@__myad` ad LEFT JOIN `#@__arctype` tp on tp.id=ad.typeid LEFT JOIN `#@__myadtype` ap on ap.id=ad.clsid WHERE $where_sql ORDER BY ad.aid desc"; | |||||
$dlist = new DataListCP(); | $dlist = new DataListCP(); | ||||
$dlist->SetTemplet(DEDEADMIN."/templets/ad_main.htm"); | $dlist->SetTemplet(DEDEADMIN."/templets/ad_main.htm"); | ||||
$dlist->SetSource($sql); | $dlist->SetSource($sql); | ||||
@@ -36,7 +34,7 @@ $dlist->display(); | |||||
function TestType($tname, $type = "") | function TestType($tname, $type = "") | ||||
{ | { | ||||
if ($tname == "") { | if ($tname == "") { | ||||
return ($type == 1) ? Lang("ad_main_testtype_1") : Lang("ad_main_testtype_0"); | |||||
return ($type == 1) ? "默认分类" : "所有栏目"; | |||||
} else { | } else { | ||||
return $tname; | return $tname; | ||||
} | } | ||||
@@ -44,9 +42,9 @@ function TestType($tname, $type = "") | |||||
function TimeSetValue($ts) | function TimeSetValue($ts) | ||||
{ | { | ||||
if ($ts == 0) { | if ($ts == 0) { | ||||
return Lang("ad_main_timeset_0"); | |||||
return "不限时间"; | |||||
} else { | } else { | ||||
return Lang("ad_main_timeset_1"); | |||||
return "限时标记"; | |||||
} | } | ||||
} | } | ||||
?> | ?> |
@@ -20,21 +20,21 @@ if ($dopost == "save") { | |||||
$pname = ${'pname_'.$startID}; | $pname = ${'pname_'.$startID}; | ||||
if (isset(${'check_'.$startID})) { | if (isset(${'check_'.$startID})) { | ||||
if ($pname != '') { | if ($pname != '') { | ||||
$query = "UPDATE `#@__myadtypee` SET typename='$pname' WHERE id='$tid'"; | |||||
$query = "UPDATE `#@__myadtypee` SET typename='$pname' WHERE id='$tid' "; | |||||
$dsql->ExecuteNoneQuery($query); | $dsql->ExecuteNoneQuery($query); | ||||
} | } | ||||
} else { | } else { | ||||
$query = "DELETE FROM `#@__myadtype` WHERE id='$tid'"; | |||||
$query = "DELETE FROM `#@__myadtype` WHERE id='$tid' "; | |||||
$dsql->ExecuteNoneQuery($query); | $dsql->ExecuteNoneQuery($query); | ||||
} | } | ||||
} | } | ||||
//增加新记录 | //增加新记录 | ||||
if (isset($check_new) && $pname_new != '') { | if (isset($check_new) && $pname_new != '') { | ||||
$query = "INSERT INTO `#@__myadtype`(typename) VALUES ('{$pname_new}');"; | |||||
$query = "INSERT INTO `#@__myadtype` (typename) VALUES ('{$pname_new}');"; | |||||
$dsql->ExecuteNoneQuery($query); | $dsql->ExecuteNoneQuery($query); | ||||
} | } | ||||
header("Content-Type: text/html; charset=utf-8"); | |||||
ShowMsg(Lang("adtype_success_edit"), 'adtype_main.php'); | |||||
header("Content-Type: text/html; charset={$cfg_soft_lang}"); | |||||
ShowMsg("成功更新广告分类列表", 'adtype_main.php'); | |||||
exit; | exit; | ||||
} | } | ||||
include DedeInclude('templets/adtype_main.htm'); | include DedeInclude('templets/adtype_main.htm'); |
@@ -8,36 +8,39 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DedeWin; | |||||
use DedeBIZ\libraries\zip; | |||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('a_New,a_AccNew'); | |||||
CheckPurview('a_New,a_AccNew'); | |||||
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(DEDEADMIN."/inc/inc_catalog_options.php"); | require_once(DEDEADMIN."/inc/inc_catalog_options.php"); | ||||
UserLogin::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) $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+1以确定当前权重 | //获取文档最大id+1以确定当前权重 | ||||
$maxWright = $dsql->GetOne("SELECT id+1 AS cc FROM `#@__archives` ORDER BY id DESC LIMIT 1"); | $maxWright = $dsql->GetOne("SELECT id+1 AS cc FROM `#@__archives` ORDER BY id DESC LIMIT 1"); | ||||
$maxWright = empty($maxWright)? array('cc'=>1) : $maxWright; | |||||
$maxWright = empty($maxWright)? array('cc'=>1) : $maxWright; | |||||
include DedeInclude("templets/album_add.htm"); | include DedeInclude("templets/album_add.htm"); | ||||
exit(); | exit(); | ||||
} | } | ||||
/*-------------------------------- | |||||
function __save(){ } | |||||
-------------------------------*/ | |||||
else if ($dopost == 'save') { | else if ($dopost == 'save') { | ||||
helper('image'); | |||||
require_once(DEDEINC.'/image.func.php'); | |||||
require_once(DEDEINC.'/libraries/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); | ||||
@@ -53,23 +56,23 @@ else if ($dopost == 'save') { | |||||
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(Lang('content_error_typeid_isempty'), "-1"); | |||||
ShowMsg("请指定文档的栏目", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (empty($channelid)) { | if (empty($channelid)) { | ||||
ShowMsg(Lang('content_error_channelid_isempty'), "-1"); | |||||
ShowMsg("文档为非指定的类型,请检查您发布内容的表单是否合法", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (!CheckChannel($typeid, $channelid)) { | if (!CheckChannel($typeid, $channelid)) { | ||||
ShowMsg(Lang('content_error_channelid_check_failed'), "-1"); | |||||
ShowMsg("您所选择的栏目与当前模型不相符,请选择白色的选项", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (!UserLogin::TestPurview('a_New')) { | |||||
UserLogin::CheckCatalog($typeid, Lang('content_error_channelid_check_failed',array('typeid'=>$typeid))); | |||||
if (!TestPurview('a_New')) { | |||||
CheckCatalog($typeid, "对不起,您没有操作栏目 {$typeid} 的权限"); | |||||
} | } | ||||
//对保存的内容进行处理 | //对保存的内容进行处理 | ||||
if (empty($writer)) $writer = $cUserLogin->getUserName(); | |||||
if (empty($source)) $source = Lang('unknow'); | |||||
if (empty($writer)) $writer = $cuserLogin->getUserName(); | |||||
if (empty($source)) $source = '未知'; | |||||
$pubdate = GetMkTime($pubdate); | $pubdate = GetMkTime($pubdate); | ||||
$senddate = time(); | $senddate = time(); | ||||
$sortrank = AddDay($pubdate, $sortup); | $sortrank = AddDay($pubdate, $sortup); | ||||
@@ -84,23 +87,27 @@ else if ($dopost == 'save') { | |||||
$keywords = cn_substrR($keywords, 60); | $keywords = cn_substrR($keywords, 60); | ||||
$filename = trim(cn_substrR($filename, 40)); | $filename = trim(cn_substrR($filename, 40)); | ||||
$userip = GetIP(); | $userip = GetIP(); | ||||
$isremote = 0; | |||||
$serviterm = empty($serviterm) ? "" : $serviterm; | $serviterm = empty($serviterm) ? "" : $serviterm; | ||||
if (!UserLogin::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)) $ddisremote = 0; | if (empty($ddisremote)) $ddisremote = 0; | ||||
$litpic = GetDDImage('none', $picname, $ddisremote); | $litpic = GetDDImage('none', $picname, $ddisremote); | ||||
//生成文档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(Lang("content_error_id_is_empty"), "-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() | |||||
------------------*/ | |||||
if ($formhtml == 1) { | if ($formhtml == 1) { | ||||
$imagebody = stripslashes($imagebody); | $imagebody = stripslashes($imagebody); | ||||
$imgurls .= GetCurContentAlbum($imagebody, $copysource, $litpicname); | $imgurls .= GetCurContentAlbum($imagebody, $copysource, $litpicname); | ||||
@@ -109,8 +116,12 @@ else if ($dopost == 'save') { | |||||
$hasone = TRUE; | $hasone = TRUE; | ||||
} | } | ||||
} | } | ||||
//处理从ZIP中解压的图片 | |||||
/*--------------------- | |||||
function _getformzip() | |||||
处理从ZIP中解压的图片 | |||||
---------------------*/ | |||||
if ($formzip == 1) { | if ($formzip == 1) { | ||||
include_once(DEDEINC."/libraries/zip.class.php"); | |||||
include_once(DEDEADMIN."/file_class.php"); | include_once(DEDEADMIN."/file_class.php"); | ||||
$zipfile = $cfg_basedir.str_replace($cfg_mainsite, '', $zipfile); | $zipfile = $cfg_basedir.str_replace($cfg_mainsite, '', $zipfile); | ||||
$tmpzipdir = DEDEDATA.'/ziptmp/'.cn_substr(md5(ExecTime()), 16); | $tmpzipdir = DEDEDATA.'/ziptmp/'.cn_substr(md5(ExecTime()), 16); | ||||
@@ -145,11 +156,10 @@ else if ($dopost == 'save') { | |||||
$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 = "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');"; | |||||
$inquery = "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');"; | |||||
$dsql->ExecuteNoneQuery($inquery); | $dsql->ExecuteNoneQuery($inquery); | ||||
$fid = $dsql->GetLastID(); | $fid = $dsql->GetLastID(); | ||||
UserLogin::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)) { | ||||
@@ -171,7 +181,7 @@ else if ($dopost == 'save') { | |||||
$album = $albumsArr[$i]; | $album = $albumsArr[$i]; | ||||
$data = explode(',', $album['img']); | $data = explode(',', $album['img']); | ||||
$ext = ".png"; | $ext = ".png"; | ||||
if (strpos($data[0], "data:image/jpeg") === 0){ | |||||
if(strpos($data[0], "data:image/jpeg") === 0){ | |||||
$ext = ".jpg"; | $ext = ".jpg"; | ||||
} elseif (strpos($data[0], "data:image/gif") === 0) { | } elseif (strpos($data[0], "data:image/gif") === 0) { | ||||
$ext = ".gif"; | $ext = ".gif"; | ||||
@@ -183,7 +193,7 @@ else if ($dopost == 'save') { | |||||
$ntime = time(); | $ntime = time(); | ||||
$savepath = $cfg_image_dir.'/'.MyDate($cfg_addon_savetype, $ntime); | $savepath = $cfg_image_dir.'/'.MyDate($cfg_addon_savetype, $ntime); | ||||
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.$ext; | $fullUrl = $fullUrl.$ext; | ||||
file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | ||||
$info = ''; | $info = ''; | ||||
@@ -214,7 +224,7 @@ else if ($dopost == 'save') { | |||||
$vs = explode(',', $v); | $vs = explode(',', $v); | ||||
if (!isset(${$vs[0]})) { | if (!isset(${$vs[0]})) { | ||||
${$vs[0]} = ''; | ${$vs[0]} = ''; | ||||
} else if ($vs[1] == 'htmltext' || $vs[1] == 'textdata') //网页文本特殊处理 | |||||
} else if ($vs[1] == 'htmltext' || $vs[1] == 'textdata') //HTML文本特殊处理 | |||||
{ | { | ||||
${$vs[0]} = AnalyseHtmlBody(${$vs[0]}, $description, $litpic, $keywords, $vs[1]); | ${$vs[0]} = AnalyseHtmlBody(${$vs[0]}, $description, $litpic, $keywords, $vs[1]); | ||||
} else { | } else { | ||||
@@ -238,54 +248,58 @@ else if ($dopost == 'save') { | |||||
//跳转网址的文档强制为动态 | //跳转网址的文档强制为动态 | ||||
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,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');"; | |||||
$query = "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($query)) { | if (!$dsql->ExecuteNoneQuery($query)) { | ||||
$gerr = $dsql->GetError(); | $gerr = $dsql->GetError(); | ||||
$dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'"); | |||||
ShowMsg(Lang('content_error_archives_save',array('error'=>str_replace('"', '', $gerr))), "javascript:;"); | |||||
$dsql->ExecuteNoneQuery(" DELETE FROM `#@__arctiny` WHERE id='$arcID' "); | |||||
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(Lang('content_error_no_maintable',array('channelid'=>$channelid)), "javascript:;"); | |||||
ShowMsg("没找到当前模型[{$channelid}]的主表信息,无法完成操作", "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$useip = GetIP(); | $useip = GetIP(); | ||||
$query = "INSERT INTO `$addtable`(aid,typeid,redirecturl,userip,pagestyle,maxwidth,imgurls,`row`,col,isrm,ddmaxwidth,pagepicnum,body{$inadd_f}) VALUES ('$arcID','$typeid','$redirecturl','$useip','$pagestyle','$maxwidth','$imgurls','$row','$col','$isrm','$ddmaxwidth','$pagepicnum','$body'{$inadd_v});"; | |||||
$query = "INSERT INTO `$addtable` (aid,typeid,redirecturl,userip,pagestyle,maxwidth,imgurls,`row`,col,isrm,ddmaxwidth,pagepicnum,body{$inadd_f}) VALUES ('$arcID','$typeid','$redirecturl','$useip','$pagestyle','$maxwidth','$imgurls','$row','$col','$isrm','$ddmaxwidth','$pagepicnum','$body'{$inadd_v}); "; | |||||
if (!$dsql->ExecuteNoneQuery($query)) { | if (!$dsql->ExecuteNoneQuery($query)) { | ||||
$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(Lang('content_error_addtable_save',array('addtable'=>$addtable, 'error'=>str_replace('"', '', $gerr))), "javascript:;"); | |||||
ShowMsg("把数据保存到数据库附加表 `{$addtable}` 时出错,请把相关信息提交给DedeBIZ官方".str_replace('"', '', $gerr), "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
//生成网页 | //生成网页 | ||||
InsertTags($tags, $arcID); | InsertTags($tags, $arcID); | ||||
$artUrl = MakeArt($arcID, TRUE, TRUE); | |||||
$artUrl = MakeArt($arcID, TRUE, TRUE, $isremote); | |||||
if ($artUrl == '') { | if ($artUrl == '') { | ||||
$artUrl = $cfg_phpurl."/view.php?aid=$arcID"; | $artUrl = $cfg_phpurl."/view.php?aid=$arcID"; | ||||
} | } | ||||
UserLogin::ClearMyAddon($arcID, $title); | |||||
ClearMyAddon($arcID, $title); | |||||
//自动更新关联内容 | //自动更新关联内容 | ||||
if (isset($automake) && 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})) { | ||||
$ids = explode(",", ${$key}); | $ids = explode(",", ${$key}); | ||||
foreach ($ids as $id) { | foreach ($ids as $id) { | ||||
MakeArt($id, true, true); | |||||
MakeArt($id, true, true, $isremote); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
//返回成功信息 | //返回成功信息 | ||||
$msg = Lang('more_actions').":<a href='album_add.php?cid=$typeid' class='btn btn-success btn-sm'>".Lang('content_continue_publish')."</a><a href='archives_do.php?aid=".$arcID."&dopost=editArchives' class='btn btn-success btn-sm'>".Lang('content_edit')."</a><a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>".Lang('content_view')."</a><a href='catalog_do.php?cid=$typeid&dopost=listArchives' class='btn btn-success btn-sm'>".Lang('content_published_main')."</a>$backurl"; | |||||
$msg = "<div>{$msg}</div>".GetUpdateTest(); | |||||
$wintitle = Lang("content_success_publish"); | |||||
$wecome_info = Lang('content_main')."::".Lang('content_add'); | |||||
DedeWin::Instance()->AddTitle(Lang("content_success_publish").":")->AddMsgItem($msg)->GetWindow("hand", " ", FALSE)->Display(); | |||||
$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(); | |||||
$wintitle = "成功发布一个图集"; | |||||
$wecome_info = "文档管理::发布图集"; | |||||
$win = new OxWindow(); | |||||
$win->AddTitle("成功发布一个图集:"); | |||||
$win->AddMsgItem($msg); | |||||
$winform = $win->GetWindow("hand", " ", FALSE); | |||||
$win->Display(); | |||||
} | } | ||||
?> | ?> |
@@ -8,28 +8,27 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DedeWin; | |||||
use DedeBIZ\libraries\zip; | |||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('a_Edit,a_AccEdit,a_MyEdit'); | |||||
CheckPurview('a_Edit,a_AccEdit,a_MyEdit'); | |||||
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"); | ||||
UserLogin::ClearMyAddon(); | |||||
require_once(DEDEINC."/dedetag.class.php"); | |||||
ClearMyAddon(); | |||||
$aid = intval($aid); | $aid = intval($aid); | ||||
//读取归档信息 | //读取归档信息 | ||||
$arcQuery = "SELECT ch.typename as channelname,ar.membername as rankname,arc.* FROM `#@__archives` arc LEFT JOIN `#@__channeltype` ch ON ch.id=arc.channel LEFT JOIN `#@__arcrank` ar ON ar.`rank`=arc.arcrank WHERE arc.id='$aid'"; | |||||
$arcQuery = "SELECT ch.typename as channelname,ar.membername as rankname,arc.* FROM `#@__archives` arc LEFT JOIN `#@__channeltype` ch ON ch.id=arc.channel 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(Lang("content_err_archive"), "-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(Lang("content_err_channel"), "javascript:;"); | |||||
ShowMsg("读取频道配置信息出错", "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$addtable = $cInfos['addtable']; | $addtable = $cInfos['addtable']; | ||||
@@ -50,8 +49,12 @@ if ($dopost != 'save') { | |||||
include DedeInclude("templets/album_edit.htm"); | include DedeInclude("templets/album_edit.htm"); | ||||
exit(); | exit(); | ||||
} | } | ||||
/*-------------------------------- | |||||
function __save(){ } | |||||
-------------------------------*/ | |||||
else if ($dopost == 'save') { | else if ($dopost == 'save') { | ||||
helper('image'); | |||||
require_once(DEDEINC.'/image.func.php'); | |||||
require_once(DEDEINC.'/libraries/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; | ||||
@@ -65,22 +68,22 @@ else if ($dopost == 'save') { | |||||
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(Lang('content_error_typeid_isempty'), "-1"); | |||||
ShowMsg("请指定文档的栏目", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (empty($channelid)) { | if (empty($channelid)) { | ||||
ShowMsg(Lang('content_error_channelid_isempty'), "-1"); | |||||
ShowMsg("文档为非指定的类型,请检查您发布内容的表单是否合法", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (!CheckChannel($typeid, $channelid)) { | if (!CheckChannel($typeid, $channelid)) { | ||||
ShowMsg(Lang('content_error_channelid_check_failed'), "-1"); | |||||
ShowMsg("您所选择的栏目与当前模型不相符,请选择白色的选项", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (!UserLogin::TestPurview('a_Edit')) { | |||||
if (UserLogin::TestPurview('a_AccEdit')) { | |||||
UserLogin::CheckCatalog($typeid, Lang('content_error_channelid_check_failed',array('typeid'=>$typeid))); | |||||
if (!TestPurview('a_Edit')) { | |||||
if (TestPurview('a_AccEdit')) { | |||||
CheckCatalog($typeid, "对不起,您没有操作栏目 {$typeid} 的文档权限"); | |||||
} else { | } else { | ||||
CheckArcAdmin($id, $cUserLogin->getUserID()); | |||||
CheckArcAdmin($id, $cuserLogin->getUserID()); | |||||
} | } | ||||
} | } | ||||
//对保存的内容进行处理 | //对保存的内容进行处理 | ||||
@@ -95,11 +98,12 @@ else if ($dopost == 'save') { | |||||
$description = cn_substrR($description, 250); | $description = cn_substrR($description, 250); | ||||
$keywords = trim(cn_substrR($keywords, 60)); | $keywords = trim(cn_substrR($keywords, 60)); | ||||
$filename = trim(cn_substrR($filename, 40)); | $filename = trim(cn_substrR($filename, 40)); | ||||
$isremote = 0; | |||||
$serviterm = empty($serviterm) ? "" : $serviterm; | $serviterm = empty($serviterm) ? "" : $serviterm; | ||||
if (!UserLogin::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; | ||||
@@ -118,28 +122,7 @@ else if ($dopost == 'save') { | |||||
if (preg_match("#j#", $flag)) $ismake = -1; | if (preg_match("#j#", $flag)) $ismake = -1; | ||||
//更新数据库的SQL语句 | //更新数据库的SQL语句 | ||||
$query = " | $query = " | ||||
UPDATE `#@__archives` SET | |||||
typeid='$typeid', | |||||
typeid2='$typeid2', | |||||
sortrank='$sortrank', | |||||
flag='$flag', | |||||
click='$click', | |||||
ismake='$ismake', | |||||
arcrank='$arcrank', | |||||
money='$money', | |||||
title='$title', | |||||
color='$color', | |||||
source='$source', | |||||
writer='$writer', | |||||
litpic='$litpic', | |||||
pubdate='$pubdate', | |||||
notpost='$notpost', | |||||
DESCription='$description', | |||||
keywords='$keywords', | |||||
shorttitle='$shorttitle', | |||||
filename='$filename', | |||||
dutyadmin='$adminid' | |||||
WHERE id='$id'; "; | |||||
UPDATE `#@__archives` SET typeid='$typeid',typeid2='$typeid2',sortrank='$sortrank',flag='$flag',click='$click',ismake='$ismake',arcrank='$arcrank',money='$money',title='$title',color='$color',source='$source',writer='$writer',litpic='$litpic',pubdate='$pubdate',notpost='$notpost',description='$description',keywords='$keywords',shorttitle='$shorttitle',filename='$filename',dutyadmin='$adminid' WHERE id='$id'; "; | |||||
if (!$dsql->ExecuteNoneQuery($query)) { | if (!$dsql->ExecuteNoneQuery($query)) { | ||||
ShowMsg("更新数据库archives表时出错,请检查".$dsql->GetError(), "javascript:;"); | ShowMsg("更新数据库archives表时出错,请检查".$dsql->GetError(), "javascript:;"); | ||||
exit(); | exit(); | ||||
@@ -168,11 +151,11 @@ else if ($dopost == 'save') { | |||||
} | } | ||||
$mime = get_mime_type($tmpFile); | $mime = get_mime_type($tmpFile); | ||||
if (preg_match("#^unknow#", $mime)) { | if (preg_match("#^unknow#", $mime)) { | ||||
ShowMsg(Lang("media_no_fileinfo"), -1); | |||||
ShowMsg("系统不支持fileinfo组件,建议php.ini中开启", -1); | |||||
exit; | exit; | ||||
} | } | ||||
if (!preg_match("#^image#i", $mime)) { | if (!preg_match("#^image#i", $mime)) { | ||||
ShowMsg(Lang("media_only_image"), -1); | |||||
ShowMsg("非图片格式文件,无法正常上传", -1); | |||||
exit; | exit; | ||||
} | } | ||||
move_uploaded_file($tmpFile, $imgfile); | move_uploaded_file($tmpFile, $imgfile); | ||||
@@ -187,7 +170,7 @@ else if ($dopost == 'save') { | |||||
} | } | ||||
$imgurls .= "{dede:img ddimg='$litpicname' text='$iinfo' width='".$imginfos[0]."' height='".$imginfos[1]."'} $iurl {/dede:img}\r\n"; | $imgurls .= "{dede:img ddimg='$litpicname' text='$iinfo' width='".$imginfos[0]."' height='".$imginfos[1]."'} $iurl {/dede:img}\r\n"; | ||||
} | } | ||||
//没上传图片,只修改msg信息 | |||||
//没上传图片(只修改msg信息) | |||||
else { | else { | ||||
$iinfo = str_replace("'", "`", stripslashes(${'imgmsg'.$i})); | $iinfo = str_replace("'", "`", stripslashes(${'imgmsg'.$i})); | ||||
$iurl = stripslashes(${'imgurl'.$i}); | $iurl = stripslashes(${'imgurl'.$i}); | ||||
@@ -208,8 +191,12 @@ else if ($dopost == 'save') { | |||||
$hasone = true; | $hasone = true; | ||||
} | } | ||||
} | } | ||||
//从ZIP文件中获取新图片 | |||||
/*--------------------- | |||||
function _getformzip() | |||||
从ZIP文件中获取新图片 | |||||
---------------------*/ | |||||
if ($formzip == 1) { | if ($formzip == 1) { | ||||
include_once(DEDEINC."/libraries/zip.class.php"); | |||||
include_once(DEDEADMIN."/file_class.php"); | include_once(DEDEADMIN."/file_class.php"); | ||||
$zipfile = $cfg_basedir.str_replace($cfg_mainsite, '', $zipfile); | $zipfile = $cfg_basedir.str_replace($cfg_mainsite, '', $zipfile); | ||||
$tmpzipdir = DEDEDATA.'/ziptmp/'.cn_substr(md5(ExecTime()), 16); | $tmpzipdir = DEDEDATA.'/ziptmp/'.cn_substr(md5(ExecTime()), 16); | ||||
@@ -238,8 +225,7 @@ else if ($dopost == 'save') { | |||||
$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 = "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');"; | |||||
$inquery = "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');"; | |||||
$dsql->ExecuteNoneQuery($inquery); | $dsql->ExecuteNoneQuery($inquery); | ||||
if ( | if ( | ||||
!$hasone && $ddisfirst == 1 | !$hasone && $ddisfirst == 1 | ||||
@@ -260,11 +246,12 @@ else if ($dopost == 'save') { | |||||
} | } | ||||
if ($albums !== "") { | if ($albums !== "") { | ||||
$albumsArr = json_decode(stripslashes($albums), true); | $albumsArr = json_decode(stripslashes($albums), true); | ||||
//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']); | ||||
$ext = ".png"; | $ext = ".png"; | ||||
if (strpos($data[0], "data:image/jpeg") === 0){ | |||||
if(strpos($data[0], "data:image/jpeg") === 0){ | |||||
$ext = ".jpg"; | $ext = ".jpg"; | ||||
} elseif (strpos($data[0], "data:image/gif") === 0) { | } elseif (strpos($data[0], "data:image/gif") === 0) { | ||||
$ext = ".gif"; | $ext = ".gif"; | ||||
@@ -276,7 +263,7 @@ else if ($dopost == 'save') { | |||||
$ntime = time(); | $ntime = time(); | ||||
$savepath = $cfg_image_dir.'/'.MyDate($cfg_addon_savetype, $ntime); | $savepath = $cfg_image_dir.'/'.MyDate($cfg_addon_savetype, $ntime); | ||||
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.$ext; | $fullUrl = $fullUrl.$ext; | ||||
file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | file_put_contents($cfg_basedir.$fullUrl, base64_decode($data[1])); | ||||
$info = ''; | $info = ''; | ||||
@@ -300,7 +287,7 @@ else if ($dopost == 'save') { | |||||
continue; | continue; | ||||
} | } | ||||
$vs = explode(',', $v); | $vs = explode(',', $v); | ||||
if ($vs[1] == 'htmltext' || $vs[1] == 'textdata') //网页文本特殊处理 | |||||
if ($vs[1] == 'htmltext' || $vs[1] == 'textdata') //HTML文本特殊处理 | |||||
{ | { | ||||
${$vs[0]} = AnalyseHtmlBody(${$vs[0]}, $description, $litpic, $keywords, $vs[1]); | ${$vs[0]} = AnalyseHtmlBody(${$vs[0]}, $description, $litpic, $keywords, $vs[1]); | ||||
} else { | } else { | ||||
@@ -314,38 +301,55 @@ else if ($dopost == '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` SET typeid='$typeid',pagestyle='$pagestyle',body='$body',maxwidth='$maxwidth',ddmaxwidth='$ddmaxwidth',pagepicnum='$pagepicnum',imgurls='$imgurls',`row`='$row',col='$col',isrm='$isrm'{$inadd_f},redirecturl='$redirecturl',userip='$useip'WHERE aid='$id';"; | |||||
$query = "Update `$addtable` | |||||
set typeid='$typeid', | |||||
pagestyle='$pagestyle', | |||||
body='$body', | |||||
maxwidth = '$maxwidth', | |||||
ddmaxwidth = '$ddmaxwidth', | |||||
pagepicnum = '$pagepicnum', | |||||
imgurls='$imgurls', | |||||
`row`='$row', | |||||
col='$col', | |||||
isrm='$isrm'{$inadd_f}, | |||||
redirecturl='$redirecturl', | |||||
userip = '$useip' | |||||
WHERE aid='$id'; "; | |||||
if (!$dsql->ExecuteNoneQuery($query)) { | if (!$dsql->ExecuteNoneQuery($query)) { | ||||
ShowMsg(Lang('content_err_update_addon',array('addtable'=>$addtable)), "javascript:;"); | |||||
ShowMsg("更新附加表 `$addtable` 时出错,请检查原因".$dsql->GetError(), "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
} | } | ||||
//生成网页 | //生成网页 | ||||
UpIndexKey($id, $arcrank, $typeid, $sortrank, $tags); | UpIndexKey($id, $arcrank, $typeid, $sortrank, $tags); | ||||
$arcUrl = MakeArt($id, true, true); | |||||
$arcUrl = MakeArt($id, true, true, $isremote); | |||||
if ($arcUrl == '') { | if ($arcUrl == '') { | ||||
$arcUrl = $cfg_phpurl."/view.php?aid=$id"; | $arcUrl = $cfg_phpurl."/view.php?aid=$id"; | ||||
} | } | ||||
UserLogin::ClearMyAddon($id, $title); | |||||
ClearMyAddon($id, $title); | |||||
//自动更新关联内容 | //自动更新关联内容 | ||||
if (isset($automake) && 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})) { | ||||
$ids = explode(",", ${$key}); | $ids = explode(",", ${$key}); | ||||
foreach ($ids as $id) { | foreach ($ids as $id) { | ||||
MakeArt($id, true, true); | |||||
MakeArt($id, true, true, $isremote); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
//返回成功信息 | //返回成功信息 | ||||
$msg = Lang('more_actions').":<a href='album_add.php?cid=$typeid' class='btn btn-success btn-sm'>".Lang('content_continue_publish')."</a><a href='archives_do.php?aid=".$id."&dopost=editArchives' class='btn btn-success btn-sm'>".Lang('content_edit')."</a><a href='$arcUrl' target='_blank' class='btn btn-success btn-sm'>".Lang('content_view')."</a><a href='catalog_do.php?cid=$typeid&dopost=listArchives' class='btn btn-success btn-sm'>".Lang('content_published_main')."</a>$backurl"; | |||||
$wintitle = Lang("content_success_edit"); | |||||
$wecome_info = Lang('content_main')."::".Lang('content_edit'); | |||||
DedeWin::Instance()->AddTitle(Lang("content_success_edit").":")->AddMsgItem($msg)->GetWindow("hand", " ", false)->Display(); | |||||
$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 = "文档管理::修改图集"; | |||||
$win = new OxWindow(); | |||||
$win->AddTitle("成功修改一个图集:"); | |||||
$win->AddMsgItem($msg); | |||||
$winform = $win->GetWindow("hand", " ", false); | |||||
$win->Display(); | |||||
} | } | ||||
?> | ?> |
@@ -8,38 +8,42 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DedeWin; | |||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__).'/config.php'); | require_once(dirname(__FILE__).'/config.php'); | ||||
UserLogin::CheckPurview('a_New,a_AccNew'); | |||||
CheckPurview('a_New,a_AccNew'); | |||||
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(DEDEADMIN.'/inc/inc_catalog_options.php'); | require_once(DEDEADMIN.'/inc/inc_catalog_options.php'); | ||||
UserLogin::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(Lang('content_err_channel_empty'), '-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']; | ||||
//获取文档最大id+1以确定当前权重 | //获取文档最大id+1以确定当前权重 | ||||
$maxWright = $dsql->GetOne("SELECT id+1 AS cc FROM `#@__archives` ORDER BY id DESC LIMIT 1"); | $maxWright = $dsql->GetOne("SELECT id+1 AS cc FROM `#@__archives` ORDER BY id DESC LIMIT 1"); | ||||
$maxWright = empty($maxWright)? array('cc'=>1) : $maxWright; | |||||
$maxWright = empty($maxWright)? array('cc'=>1) : $maxWright; | |||||
include DedeInclude('templets/archives_add.htm'); | include DedeInclude('templets/archives_add.htm'); | ||||
exit(); | exit(); | ||||
} | } | ||||
/*-------------------------------- | |||||
function __save(){ } | |||||
-------------------------------*/ | |||||
else if ($dopost == 'save') { | else if ($dopost == 'save') { | ||||
helper('image'); | |||||
require_once(DEDEINC.'/image.func.php'); | |||||
require_once(DEDEINC.'/libraries/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); | ||||
@@ -50,23 +54,23 @@ else if ($dopost == 'save') { | |||||
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(Lang('content_error_typeid_isempty'), '-1'); | |||||
ShowMsg('请指定文档的栏目', '-1'); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (empty($channelid)) { | if (empty($channelid)) { | ||||
ShowMsg(Lang('content_error_channelid_isempty'), '-1'); | |||||
ShowMsg('文档为非指定的类型,请检查您发布内容的表单是否合法', '-1'); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (!CheckChannel($typeid, $channelid)) { | if (!CheckChannel($typeid, $channelid)) { | ||||
ShowMsg(Lang('content_error_channelid_check_failed'), '-1'); | |||||
ShowMsg('您所选择的栏目与当前模型不相符,请选择白色的选项', '-1'); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (!UserLogin::TestPurview('a_New')) { | |||||
UserLogin::CheckCatalog($typeid, Lang('content_error_channelid_check_failed',array('typeid'=>$typeid))); | |||||
if (!TestPurview('a_New')) { | |||||
CheckCatalog($typeid, "对不起,您没有操作栏目 {$typeid} 的权限"); | |||||
} | } | ||||
//对保存的内容进行处理 | //对保存的内容进行处理 | ||||
if (empty($writer)) $writer = $cUserLogin->getUserName(); | |||||
if (empty($source)) $source = Lang('unknow'); | |||||
if (empty($writer)) $writer = $cuserLogin->getUserName(); | |||||
if (empty($source)) $source = '未知'; | |||||
$pubdate = GetMkTime($pubdate); | $pubdate = GetMkTime($pubdate); | ||||
$senddate = time(); | $senddate = time(); | ||||
$sortrank = AddDay($pubdate, $sortup); | $sortrank = AddDay($pubdate, $sortup); | ||||
@@ -81,11 +85,13 @@ else if ($dopost == 'save') { | |||||
$keywords = cn_substrR($keywords, 60); | $keywords = cn_substrR($keywords, 60); | ||||
$filename = trim(cn_substrR($filename, 40)); | $filename = trim(cn_substrR($filename, 40)); | ||||
$userip = GetIP(); | $userip = GetIP(); | ||||
$isremote = 0; | |||||
$voteid = (empty($voteid) ? 0 : $voteid); | |||||
$serviterm = empty($serviterm) ? "" : $serviterm; | $serviterm = empty($serviterm) ? "" : $serviterm; | ||||
if (!UserLogin::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; | ||||
@@ -94,7 +100,7 @@ else if ($dopost == 'save') { | |||||
//生成文档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(Lang("content_error_id_is_empty"), "-1"); | |||||
ShowMsg("无法获得主键,因此无法进行后续操作", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
//分析处理附加表数据 | //分析处理附加表数据 | ||||
@@ -126,50 +132,54 @@ else if ($dopost == 'save') { | |||||
//跳转网址的文档强制为动态 | //跳转网址的文档强制为动态 | ||||
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,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');"; | |||||
$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','$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(Lang('content_error_archives_save',array('error'=>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)) { | ||||
$useip = GetIP(); | $useip = GetIP(); | ||||
$query = "INSERT INTO `{$addtable}`(aid,typeid,redirecturl,userip,templet{$inadd_f}) VALUES ('$arcID','$typeid','$redirecturl','$useip',''{$inadd_v})"; | |||||
$query = "INSERT INTO `{$addtable}` (aid,typeid,redirecturl,userip{$inadd_f}) VALUES ('$arcID','$typeid','$redirecturl','$useip'{$inadd_v})"; | |||||
if (!$dsql->ExecuteNoneQuery($query)) { | if (!$dsql->ExecuteNoneQuery($query)) { | ||||
$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(Lang('content_error_addtable_save',array('addtable'=>$addtable, 'error'=>str_replace('"', '', $gerr))), "javascript:;"); | |||||
ShowMsg("把数据保存到数据库附加表 `{$addtable}` 时出错,请把相关信息提交给DedeBIZ官方".str_replace('"', '', $gerr), "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
} | } | ||||
//生成网页 | //生成网页 | ||||
InsertTags($tags, $arcID); | InsertTags($tags, $arcID); | ||||
$artUrl = MakeArt($arcID, true, true); | |||||
$artUrl = MakeArt($arcID, true, true, $isremote); | |||||
if ($artUrl == '') { | if ($artUrl == '') { | ||||
$artUrl = $cfg_phpurl."/view.php?aid=$arcID"; | $artUrl = $cfg_phpurl."/view.php?aid=$arcID"; | ||||
} | } | ||||
UserLogin::ClearMyAddon($arcID, $title); | |||||
ClearMyAddon($arcID, $title); | |||||
//自动更新关联内容 | //自动更新关联内容 | ||||
if (isset($automake) && 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})) { | ||||
$ids = explode(",", ${$key}); | $ids = explode(",", ${$key}); | ||||
foreach ($ids as $id) { | foreach ($ids as $id) { | ||||
MakeArt($id, true, true); | |||||
MakeArt($id, true, true, $isremote); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
//返回成功信息 | //返回成功信息 | ||||
$msg = Lang('more_actions').":<a href='archives_add.php?cid=$typeid' class='btn btn-success btn-sm'>".Lang('content_continue_publish')."</a><a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>".Lang('content_view')."</a><a href='archives_do.php?aid=".$arcID."&dopost=editArchives' class='btn btn-success btn-sm'>".Lang('content_edit')."</a><a href='catalog_do.php?cid=$typeid&dopost=listArchives' class='btn btn-success btn-sm'>".Lang('content_published_main')."</a>$backurl"; | |||||
$msg = "<div>{$msg}</div>".GetUpdateTest(); | |||||
$wintitle = Lang("content_success_publish"); | |||||
$wecome_info = Lang('content_main')."::".Lang('content_add'); | |||||
DedeWin::Instance()->AddTitle(Lang("content_success_publish").':')->AddMsgItem($msg)->GetWindow('hand', ' ', false)->Display(); | |||||
$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(); | |||||
$wintitle = '成功发布商品'; | |||||
$wecome_info = '文档管理::发布商品'; | |||||
$win = new OxWindow(); | |||||
$win->AddTitle('成功发布商品:'); | |||||
$win->AddMsgItem($msg); | |||||
$winform = $win->GetWindow('hand', ' ', false); | |||||
$win->Display(); | |||||
} | } | ||||
?> | ?> |
@@ -8,37 +8,35 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Archive\Archives; | |||||
use DedeBIZ\libraries\DedeBIZ; | |||||
use DedeBIZ\libraries\DedeWin; | |||||
use DedeBIZ\libraries\SplitWord; | |||||
use DedeBIZ\Login\UserLogin; | |||||
use DedeBIZ\TypeLink\TypeLink; | |||||
use DedeBIZ\TypeLink\TypeUnitSelector; | |||||
require_once(dirname(__FILE__).'/config.php'); | require_once(dirname(__FILE__).'/config.php'); | ||||
require_once(DEDEADMIN.'/inc/inc_batchup.php'); | require_once(DEDEADMIN.'/inc/inc_batchup.php'); | ||||
require_once(DEDEADMIN.'/inc/inc_archives_functions.php'); | require_once(DEDEADMIN.'/inc/inc_archives_functions.php'); | ||||
require_once(DEDEINC.'/typelink/typelink.class.php'); | |||||
require_once(DEDEINC.'/archive/archives.class.php'); | |||||
$ENV_GOBACK_URL = (empty($_COOKIE['ENV_GOBACK_URL']) ? 'content_list.php' : $_COOKIE['ENV_GOBACK_URL']); | $ENV_GOBACK_URL = (empty($_COOKIE['ENV_GOBACK_URL']) ? 'content_list.php' : $_COOKIE['ENV_GOBACK_URL']); | ||||
if (empty($dopost)) { | if (empty($dopost)) { | ||||
ShowMsg(Lang('invalid_parameter'), '-1'); | |||||
ShowMsg('对不起,您没指定运行参数', '-1'); | |||||
exit(); | exit(); | ||||
} | } | ||||
$aid = isset($aid) ? preg_replace("#[^0-9]#", '', $aid) : ''; | $aid = isset($aid) ? preg_replace("#[^0-9]#", '', $aid) : ''; | ||||
/*-------------------------- | |||||
//编辑文档 | //编辑文档 | ||||
function editArchives(){ } | |||||
---------------------------*/ | |||||
if ($dopost == 'editArchives') { | if ($dopost == 'editArchives') { | ||||
$query = "SELECT arc.id,arc.typeid,ch.maintable,ch.editcon FROM `#@__arctiny` arc LEFT JOIN `#@__arctype` tp ON tp.id=arc.typeid LEFT JOIN `#@__channeltype` ch ON ch.id=arc.channel WHERE arc.id='$aid'"; | |||||
$query = "SELECT arc.id,arc.typeid,ch.maintable,ch.editcon FROM `#@__arctiny` arc LEFT JOIN `#@__arctype` tp ON tp.id=arc.typeid LEFT JOIN `#@__channeltype` ch ON ch.id=arc.channel WHERE arc.id='$aid' "; | |||||
$row = $dsql->GetOne($query); | $row = $dsql->GetOne($query); | ||||
$gurl = $row['editcon']; | $gurl = $row['editcon']; | ||||
if ($gurl == '') $gurl = 'article_edit.php'; | if ($gurl == '') $gurl = 'article_edit.php'; | ||||
header("location:{$gurl}?aid=$aid"); | header("location:{$gurl}?aid=$aid"); | ||||
exit(); | exit(); | ||||
} else if ($dopost == 'upload_base64_image') { | |||||
} else if($dopost == 'upload_base64_image') { | |||||
if ($litpic_b64 != "") { | if ($litpic_b64 != "") { | ||||
$data = explode(',', $litpic_b64); | $data = explode(',', $litpic_b64); | ||||
$ntime = time(); | $ntime = time(); | ||||
$savepath = $cfg_image_dir.'/'.MyDate($cfg_addon_savetype, $ntime); | $savepath = $cfg_image_dir.'/'.MyDate($cfg_addon_savetype, $ntime); | ||||
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])); | ||||
//加水印 | //加水印 | ||||
@@ -60,15 +58,18 @@ if ($dopost == 'editArchives') { | |||||
} | } | ||||
exit(); | exit(); | ||||
} | } | ||||
/*-------------------------- | |||||
//浏览文档 | //浏览文档 | ||||
function viewArchives(){ } | |||||
---------------------------*/ | |||||
else if ($dopost == "viewArchives") { | else if ($dopost == "viewArchives") { | ||||
$aid = preg_replace("#[^0-9]#", '', $aid); | $aid = preg_replace("#[^0-9]#", '', $aid); | ||||
//获取主表信息 | //获取主表信息 | ||||
$query = "SELECT arc.*,ch.maintable,ch.addtable,ch.issystem,ch.editcon,tp.typedir,tp.typename,tp.corank,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.sitepath,tp.siteurl FROM `#@__arctiny` arc LEFT JOIN `#@__arctype` tp ON tp.id=arc.typeid LEFT JOIN `#@__channeltype` ch ON ch.id=tp.channeltype WHERE arc.id='$aid'"; | |||||
$query = "SELECT arc.*,ch.maintable,ch.addtable,ch.issystem,ch.editcon,tp.typedir,tp.typename,tp.corank,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.sitepath,tp.siteurl FROM `#@__arctiny` arc LEFT JOIN `#@__arctype` tp ON tp.id=arc.typeid LEFT JOIN `#@__channeltype` ch ON ch.id=tp.channeltype WHERE arc.id='$aid' "; | |||||
$trow = $dsql->GetOne($query); | $trow = $dsql->GetOne($query); | ||||
$trow['maintable'] = (trim($trow['maintable']) == '' ? '#@__archives' : trim($trow['maintable'])); | $trow['maintable'] = (trim($trow['maintable']) == '' ? '#@__archives' : trim($trow['maintable'])); | ||||
if ($trow['issystem'] != -1) { | if ($trow['issystem'] != -1) { | ||||
$arcQuery = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.sitepath,tp.siteurl FROM `{$trow['maintable']}` arc LEFT JOIN `#@__arctype` tp on arc.typeid=tp.id LEFT JOIN `#@__channeltype` ch on ch.id=arc.channel WHERE arc.id='$aid'"; | |||||
$arcQuery = "SELECT arc.*,tp.typedir,tp.typename,tp.corank,tp.namerule,tp.namerule2,tp.ispart,tp.moresite,tp.sitepath,tp.siteurl FROM `{$trow['maintable']}` arc LEFT JOIN `#@__arctype` tp on arc.typeid=tp.id LEFT JOIN `#@__channeltype` ch on ch.id=arc.channel WHERE arc.id='$aid' "; | |||||
$arcRow = $dsql->GetOne($arcQuery); | $arcRow = $dsql->GetOne($arcQuery); | ||||
PutCookie('DedeUserID', $arcRow['mid'], 1800); | PutCookie('DedeUserID', $arcRow['mid'], 1800); | ||||
PutCookie('DedeLoginTime', time(), 1800); | PutCookie('DedeLoginTime', time(), 1800); | ||||
@@ -128,30 +129,33 @@ else if ($dopost == "viewArchives") { | |||||
echo "<script>location.href='$arcurl"."?".time()."';</script>"; | echo "<script>location.href='$arcurl"."?".time()."';</script>"; | ||||
exit(); | exit(); | ||||
} | } | ||||
/*-------------------------- | |||||
//异步上传缩略图 | //异步上传缩略图 | ||||
function uploadLitpic(){ } | |||||
---------------------------*/ | |||||
else if ($dopost == "uploadLitpic") { | else if ($dopost == "uploadLitpic") { | ||||
$upfile = AdminUpload('litpic', 'imagelit', 0, false); | $upfile = AdminUpload('litpic', 'imagelit', 0, false); | ||||
if ($upfile == '-1') { | if ($upfile == '-1') { | ||||
$msg = "<script> | $msg = "<script> | ||||
parent.document.getElementById('uploadwait').style.display = 'none'; | parent.document.getElementById('uploadwait').style.display = 'none'; | ||||
alert('".Lang('content_err_upload_litpic_-1')."'); | |||||
alert('您没指定要上传文件或文件大小超过限制'); | |||||
</script>"; | </script>"; | ||||
} else if ($upfile == '-2') { | } else if ($upfile == '-2') { | ||||
$msg = "<script> | $msg = "<script> | ||||
parent.document.getElementById('uploadwait').style.display = 'none'; | parent.document.getElementById('uploadwait').style.display = 'none'; | ||||
alert('".Lang('content_err_upload_litpic_-2')."'); | |||||
alert('上传文件失败,请检查原因'); | |||||
</script>"; | </script>"; | ||||
} else if ($upfile == '0') { | } else if ($upfile == '0') { | ||||
$msg = "<script> | $msg = "<script> | ||||
parent.document.getElementById('uploadwait').style.display = 'none'; | parent.document.getElementById('uploadwait').style.display = 'none'; | ||||
alert('".Lang('content_err_upload_litpic_0')."'); | |||||
alert('文件类型不正确'); | |||||
</script>"; | </script>"; | ||||
} else { | } else { | ||||
if (!empty($cfg_uplitpic_cut) && $cfg_uplitpic_cut == 'N') { | if (!empty($cfg_uplitpic_cut) && $cfg_uplitpic_cut == 'N') { | ||||
$msg = "<script> | $msg = "<script> | ||||
parent.document.getElementById('uploadwait').style.display = 'none'; | parent.document.getElementById('uploadwait').style.display = 'none'; | ||||
parent.document.getElementById('picname').value = '{$upfile}'; | parent.document.getElementById('picname').value = '{$upfile}'; | ||||
if (parent.document.getElementById('divpicview')) | |||||
if(parent.document.getElementById('divpicview')) | |||||
{ | { | ||||
parent.document.getElementById('divpicview').style.width = '150px'; | parent.document.getElementById('divpicview').style.width = '150px'; | ||||
parent.document.getElementById('divpicview').innerHTML = \"<img src='{$upfile}?n' width='150'>\"; | parent.document.getElementById('divpicview').innerHTML = \"<img src='{$upfile}?n' width='150'>\"; | ||||
@@ -167,43 +171,49 @@ else if ($dopost == "uploadLitpic") { | |||||
echo $msg; | echo $msg; | ||||
exit(); | exit(); | ||||
} | } | ||||
/*-------------------------- | |||||
//推荐文档 | //推荐文档 | ||||
function commendArchives(){ } | |||||
---------------------------*/ | |||||
else if ($dopost == "commendArchives") { | else if ($dopost == "commendArchives") { | ||||
UserLogin::CheckPurview('a_Commend,sys_ArcBatch'); | |||||
CheckPurview('a_Commend,sys_ArcBatch'); | |||||
if (!empty($aid) && empty($qstr)) { | if (!empty($aid) && empty($qstr)) { | ||||
$qstr = $aid; | $qstr = $aid; | ||||
} | } | ||||
if ($qstr == '') { | if ($qstr == '') { | ||||
ShowMsg(Lang("invalid_parameter"), $ENV_GOBACK_URL); | |||||
ShowMsg("参数无效", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} | } | ||||
$arcids = preg_replace("#[^0-9,]#", '', preg_replace("#`#", ',', $qstr)); | $arcids = preg_replace("#[^0-9,]#", '', preg_replace("#`#", ',', $qstr)); | ||||
$query = "SELECT arc.id,arc.typeid,ch.issystem,ch.maintable,ch.addtable FROM `#@__arctiny` arc LEFT JOIN `#@__arctype` tp on tp.id=arc.typeid LEFT JOIN `#@__channeltype` ch on ch.id=tp.channeltype WHERE arc.id in($arcids)"; | |||||
$query = "SELECT arc.id,arc.typeid,ch.issystem,ch.maintable,ch.addtable FROM `#@__arctiny` arc LEFT JOIN `#@__arctype` tp on tp.id=arc.typeid LEFT JOIN `#@__channeltype` ch on ch.id=tp.channeltype WHERE arc.id in($arcids) "; | |||||
$dsql->SetQuery($query); | $dsql->SetQuery($query); | ||||
$dsql->Execute(); | $dsql->Execute(); | ||||
while ($row = $dsql->GetArray()) { | while ($row = $dsql->GetArray()) { | ||||
$aid = $row['id']; | $aid = $row['id']; | ||||
if ($row['issystem'] != -1) { | if ($row['issystem'] != -1) { | ||||
$maintable = (trim($row['maintable']) == '' ? '#@__archives' : trim($row['maintable'])); | $maintable = (trim($row['maintable']) == '' ? '#@__archives' : trim($row['maintable'])); | ||||
$arr = $dsql->GetOne("SELECT flag FROM `{$maintable}` WHERE id='$aid'"); | |||||
$arr = $dsql->GetOne("SELECT flag FROM `{$maintable}` WHERE id='$aid' "); | |||||
$flag = ($arr['flag'] == '' ? 'c' : $arr['flag'].',c'); | $flag = ($arr['flag'] == '' ? 'c' : $arr['flag'].',c'); | ||||
$dsql->ExecuteNoneQuery("UPDATE `{$maintable}` SET `flag`='$flag' WHERE id='{$aid}'"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `{$maintable}` SET `flag`='$flag' WHERE id='{$aid}' "); | |||||
} else { | } else { | ||||
$maintable = trim($row['addtable']); | $maintable = trim($row['addtable']); | ||||
$arr = $dsql->GetOne("SELECT flag FROM `{$maintable}` WHERE aid='$aid'"); | |||||
$arr = $dsql->GetOne("SELECT flag From `{$maintable}` where aid='$aid' "); | |||||
$flag = ($arr['flag'] == '' ? 'c' : $arr['flag'].',c'); | $flag = ($arr['flag'] == '' ? 'c' : $arr['flag'].',c'); | ||||
$dsql->ExecuteNoneQuery("UPDATE `{$maintable}` SET `flag`='$flag' WHERE aid='{$aid}'"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `{$maintable}` SET `flag`='$flag' WHERE aid='{$aid}' "); | |||||
} | } | ||||
} | } | ||||
ShowMsg(Lang("content_success_commend_archives"), $ENV_GOBACK_URL); | |||||
ShowMsg("成功把所选文档设为推荐", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} | } | ||||
/*-------------------------- | |||||
//生成网页 | //生成网页 | ||||
function makeArchives(); | |||||
---------------------------*/ | |||||
else if ($dopost == "makeArchives") { | else if ($dopost == "makeArchives") { | ||||
UserLogin::CheckPurview('sys_MakeHtml,sys_ArcBatch'); | |||||
CheckPurview('sys_MakeHtml,sys_ArcBatch'); | |||||
if (!empty($aid) && empty($qstr)) $qstr = $aid; | if (!empty($aid) && empty($qstr)) $qstr = $aid; | ||||
if ($qstr == '') { | if ($qstr == '') { | ||||
ShowMsg(Lang("invalid_parameter"), $ENV_GOBACK_URL); | |||||
ShowMsg('参数无效', $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} | } | ||||
require_once(DEDEADMIN.'/inc/inc_archives_functions.php'); | require_once(DEDEADMIN.'/inc/inc_archives_functions.php'); | ||||
@@ -213,47 +223,54 @@ else if ($dopost == "makeArchives") { | |||||
$i++; | $i++; | ||||
$pageurl = MakeArt($aid, false); | $pageurl = MakeArt($aid, false); | ||||
} | } | ||||
ShowMsg(Lang('templets_one_makei_success',array('i'=>$i)), $ENV_GOBACK_URL); | |||||
ShowMsg("成功更新指定 $i 个文件", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} | } | ||||
/*-------------------------- | |||||
//审核文档 | //审核文档 | ||||
function checkArchives() { } | |||||
---------------------------*/ | |||||
else if ($dopost == "checkArchives") { | else if ($dopost == "checkArchives") { | ||||
UserLogin::CheckPurview('a_Check,a_AccCheck,sys_ArcBatch'); | |||||
CheckPurview('a_Check,a_AccCheck,sys_ArcBatch'); | |||||
require_once(DEDEADMIN."/inc/inc_archives_functions.php"); | require_once(DEDEADMIN."/inc/inc_archives_functions.php"); | ||||
if (!empty($aid) && empty($qstr)) $qstr = $aid; | if (!empty($aid) && empty($qstr)) $qstr = $aid; | ||||
if ($qstr == '') { | if ($qstr == '') { | ||||
ShowMsg(Lang("invalid_parameter"), $ENV_GOBACK_URL); | |||||
ShowMsg("参数无效", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} | } | ||||
$arcids = preg_replace("#[^0-9,]#", '', preg_replace("#`#", ',', $qstr)); | $arcids = preg_replace("#[^0-9,]#", '', preg_replace("#`#", ',', $qstr)); | ||||
$query = "SELECT arc.id,arc.typeid,ch.issystem,ch.maintable,ch.addtable FROM `#@__arctiny` arc LEFT JOIN `#@__arctype` tp ON tp.id=arc.typeid LEFT JOIN `#@__channeltype` ch ON ch.id=tp.channeltype WHERE arc.id in($arcids)"; | |||||
$query = "SELECT arc.id,arc.typeid,ch.issystem,ch.maintable,ch.addtable FROM `#@__arctiny` arc LEFT JOIN `#@__arctype` tp ON tp.id=arc.typeid LEFT JOIN `#@__channeltype` ch ON ch.id=tp.channeltype WHERE arc.id in($arcids) "; | |||||
$dsql->SetQuery($query); | $dsql->SetQuery($query); | ||||
$dsql->Execute('ckall'); | $dsql->Execute('ckall'); | ||||
while ($row = $dsql->GetArray('ckall')) { | while ($row = $dsql->GetArray('ckall')) { | ||||
$aid = $row['id']; | $aid = $row['id']; | ||||
$maintable = (trim($row['maintable']) == '' ? '#@__archives' : trim($row['maintable'])); | $maintable = (trim($row['maintable']) == '' ? '#@__archives' : trim($row['maintable'])); | ||||
$dsql->ExecuteNoneQuery("UPDATE `#@__arctiny` SET arcrank='0' WHERE id='$aid'"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `#@__arctiny` SET arcrank='0' WHERE id='$aid' "); | |||||
if ($row['issystem'] == -1) { | if ($row['issystem'] == -1) { | ||||
$dsql->ExecuteNoneQuery("UPDATE `".trim($row['addtable'])."` SET arcrank='0' WHERE aid='$aid'"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `".trim($row['addtable'])."` SET arcrank='0' WHERE aid='$aid' "); | |||||
} else { | } else { | ||||
$dsql->ExecuteNoneQuery("UPDATE `$maintable` SET arcrank='0', dutyadmin='".$cUserLogin->getUserID()."' WHERE id='$aid'"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `$maintable` SET arcrank='0', dutyadmin='".$cuserLogin->getUserID()."' WHERE id='$aid' "); | |||||
} | } | ||||
$dsql->ExecuteNoneQuery("UPDATE `#@__taglist` SET arcrank='0' WHERE aid='$aid'"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `#@__taglist` SET arcrank='0' WHERE aid='$aid' "); | |||||
$pageurl = MakeArt($aid, false); | $pageurl = MakeArt($aid, false); | ||||
} | } | ||||
ShowMsg(Lang("content_success_check_archives"), $ENV_GOBACK_URL); | |||||
ShowMsg("成功审核指定文档", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} | } | ||||
/*----------------------------- | |||||
function moveArchives(){ } | |||||
------------------------------*/ | |||||
else if ($dopost == 'moveArchives') { | else if ($dopost == 'moveArchives') { | ||||
UserLogin::CheckPurview('sys_ArcBatch'); | |||||
CheckPurview('sys_ArcBatch'); | |||||
if (empty($totype)) { | if (empty($totype)) { | ||||
require_once(DEDEINC.'/typelink/typelink.class.php'); | |||||
if (!empty($aid) && empty($qstr)) $qstr = $aid; | if (!empty($aid) && empty($qstr)) $qstr = $aid; | ||||
AjaxHead(); | AjaxHead(); | ||||
$channelid = empty($channelid) ? 0 : $channelid; | $channelid = empty($channelid) ? 0 : $channelid; | ||||
$tl = new TypeLink($aid); | $tl = new TypeLink($aid); | ||||
$typeOptions = $tl->GetOptionArray(0, $admin_catalogs, $channelid); | $typeOptions = $tl->GetOptionArray(0, $admin_catalogs, $channelid); | ||||
$typeOptions = "<select name='totype' style='width:320px'> | $typeOptions = "<select name='totype' style='width:320px'> | ||||
<option value='0'>".Lang('content_move_archives')."</option> | |||||
<option value='0'>请选择移动位置</option> | |||||
$typeOptions | $typeOptions | ||||
</select>"; | </select>"; | ||||
//输出AJAX可移动窗体 | //输出AJAX可移动窗体 | ||||
@@ -265,20 +282,20 @@ else if ($dopost == 'moveArchives') { | |||||
echo "<table width='100%' style='display:inline-block;padding:2px;z-index:9000'>"; | echo "<table width='100%' style='display:inline-block;padding:2px;z-index:9000'>"; | ||||
?> | ?> | ||||
<tr> | <tr> | ||||
<td width="90" class="bline"> <?php echo Lang('content_move_typeid');?>:</td> | |||||
<td width="90" class="bline"> 目标栏目:</td> | |||||
<td class="bline"><?php echo $typeOptions;?></td> | <td class="bline"><?php echo $typeOptions;?></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td width="90" class="bline"> <?php echo Lang('freelist_orderby_id');?>:</td> | |||||
<td width="90" class="bline"> 文档id:</td> | |||||
<td class="bline"> | <td class="bline"> | ||||
<input type="text" name="tmpids" value="<?php echo $qstr;?>" style="width:320px;overflow:hidden"><br> | <input type="text" name="tmpids" value="<?php echo $qstr;?>" style="width:320px;overflow:hidden"><br> | ||||
<?php echo Lang('content_move_tip');?> | |||||
移动到目标栏目必须和选定文档频道类型一致,否则程序会自动勿略不符合文档 | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td colspan="2" align="center" class="py-2"> | <td colspan="2" align="center" class="py-2"> | ||||
<button type="submit" class="btn btn-success btn-sm"><?php echo Lang('save');?></button> | |||||
<button type="button" onclick="HideObj('<?php echo $divname;?>');ChangeFullDiv('hide');" class="btn btn-success btn-sm"><?php echo Lang('close');?></button> | |||||
<button type="submit" class="btn btn-success btn-sm">保存</button> | |||||
<button type="button" onclick="HideObj('<?php echo $divname;?>');ChangeFullDiv('hide');" class="btn btn-success btn-sm">关闭</button> | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
@@ -287,14 +304,14 @@ else if ($dopost == 'moveArchives') { | |||||
//AJAX窗体结束 | //AJAX窗体结束 | ||||
} else { | } else { | ||||
$totype = preg_replace("#[^0-9]#", '', $totype); | $totype = preg_replace("#[^0-9]#", '', $totype); | ||||
$typeInfos = $dsql->GetOne("SELECT tp.channeltype,tp.ispart,tp.channeltype,ch.maintable,ch.addtable,ch.issystem FROM `#@__arctype` tp LEFT JOIN `#@__channeltype` ch on ch.id=tp.channeltype WHERE tp.id='$totype'"); | |||||
$typeInfos = $dsql->GetOne("SELECT tp.channeltype,tp.ispart,tp.channeltype,ch.maintable,ch.addtable,ch.issystem FROM `#@__arctype` tp LEFT JOIN `#@__channeltype` ch on ch.id=tp.channeltype WHERE tp.id='$totype' "); | |||||
$idtype = "id"; | $idtype = "id"; | ||||
if (!is_array($typeInfos)) { | if (!is_array($typeInfos)) { | ||||
ShowMsg(Lang('invalid_parameter'), '-1'); | |||||
ShowMsg('参数错误', '-1'); | |||||
exit(); | exit(); | ||||
} | } | ||||
if ($typeInfos['ispart'] != 0) { | if ($typeInfos['ispart'] != 0) { | ||||
ShowMsg(Lang('content_move_err_ispart'), '-1'); | |||||
ShowMsg('文档保存栏目必须为最终列表栏目', '-1'); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (empty($typeInfos['addtable'])) { | if (empty($typeInfos['addtable'])) { | ||||
@@ -309,54 +326,62 @@ else if ($dopost == 'moveArchives') { | |||||
$arc = ''; | $arc = ''; | ||||
$j = 0; | $j = 0; | ||||
$okids = array(); | $okids = array(); | ||||
$dsql->SetQuery("SELECT {$idtype},typeid FROM `{$typeInfos['maintable']}` WHERE {$idtype} in($arcids) AND channel='{$typeInfos['channeltype']}'"); | |||||
$dsql->SetQuery("SELECT {$idtype},typeid FROM `{$typeInfos['maintable']}` WHERE {$idtype} in($arcids) AND channel='{$typeInfos['channeltype']}' "); | |||||
$dsql->Execute(); | $dsql->Execute(); | ||||
while ($row = $dsql->GetArray()) { | while ($row = $dsql->GetArray()) { | ||||
if ($row['typeid'] != $totype) { | if ($row['typeid'] != $totype) { | ||||
$dsql->ExecuteNoneQuery("UPDATE `#@__arctiny` SET typeid='$totype' WHERE id='{$row[$idtype]}'"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `{$typeInfos['maintable']}` SET typeid='$totype' WHERE id='{$row[$idtype]}'"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `{$typeInfos['addtable']}` SET typeid='$totype' WHERE aid='{$row[$idtype]}'"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `#@__arctiny` SET typeid='$totype' WHERE id='{$row[$idtype]}' "); | |||||
$dsql->ExecuteNoneQuery("UPDATE `{$typeInfos['maintable']}` SET typeid='$totype' WHERE id='{$row[$idtype]}' "); | |||||
$dsql->ExecuteNoneQuery("UPDATE `{$typeInfos['addtable']}` SET typeid='$totype' WHERE aid='{$row[$idtype]}' "); | |||||
$okids[] = $row[$idtype]; | $okids[] = $row[$idtype]; | ||||
$j++; | $j++; | ||||
} | } | ||||
} | } | ||||
//更新网页 | |||||
//更新HTML | |||||
foreach ($okids as $aid) { | foreach ($okids as $aid) { | ||||
$arc = new Archives($aid); | $arc = new Archives($aid); | ||||
$arc->MakeHtml(); | $arc->MakeHtml(); | ||||
} | } | ||||
ShowMsg(Lang("content_move_success",array('j'=>$j)), $ENV_GOBACK_URL); | |||||
ShowMsg("成功移动 $j 个文档", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} | } | ||||
} | } | ||||
/*----------------------------- | |||||
//还原文档 | //还原文档 | ||||
function RbReturnArchives(){ } | |||||
------------------------------*/ | |||||
else if ($dopost == 'return') { | else if ($dopost == 'return') { | ||||
UserLogin::CheckPurview('a_Del,a_AccDel,a_MyDel,sys_ArcBatch'); | |||||
CheckPurview('a_Del,a_AccDel,a_MyDel,sys_ArcBatch'); | |||||
require_once(DEDEINC."/libraries/oxwindow.class.php"); | |||||
if (!empty($aid) && empty($qstr)) $qstr = $aid; | if (!empty($aid) && empty($qstr)) $qstr = $aid; | ||||
if ($qstr == '') { | if ($qstr == '') { | ||||
ShowMsg(Lang("invalid_parameter"), "recycling.php"); | |||||
ShowMsg("参数无效", "recycling.php"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$qstrs = explode('`', $qstr); | $qstrs = explode('`', $qstr); | ||||
foreach ($qstrs as $aid) { | foreach ($qstrs as $aid) { | ||||
$dsql->ExecuteNoneQuery("UPDATE `#@__archives` SET arcrank='-1',ismake='0' WHERE id='$aid'"); | $dsql->ExecuteNoneQuery("UPDATE `#@__archives` SET arcrank='-1',ismake='0' WHERE id='$aid'"); | ||||
$dsql->ExecuteNoneQuery("UPDATE `#@__arctiny` SET `arcrank` = '-1' WHERE id = '$aid';"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `#@__arctiny` SET `arcrank` = '-1' WHERE id = '$aid'; "); | |||||
} | } | ||||
ShowMsg(Lang("content_return_success"), "recycling.php"); | |||||
ShowMsg("成功还原指定文档", "recycling.php"); | |||||
exit(); | exit(); | ||||
} | } | ||||
/*-------------------------- | |||||
//删除文档 | //删除文档 | ||||
function delArchives(){ } | |||||
---------------------------*/ | |||||
else if ($dopost == "delArchives") { | else if ($dopost == "delArchives") { | ||||
UserLogin::CheckPurview('a_Del,a_AccDel,a_MyDel,sys_ArcBatch'); | |||||
CheckPurview('a_Del,a_AccDel,a_MyDel,sys_ArcBatch'); | |||||
require_once(DEDEINC."/libraries/oxwindow.class.php"); | |||||
if (empty($fmdo)) $fmdo = ''; | if (empty($fmdo)) $fmdo = ''; | ||||
if ($fmdo == 'yes') { | if ($fmdo == 'yes') { | ||||
if (!empty($aid) && empty($qstr)) { | if (!empty($aid) && empty($qstr)) { | ||||
$qstr = $aid; | $qstr = $aid; | ||||
} | } | ||||
if ($qstr == '') { | if ($qstr == '') { | ||||
ShowMsg(Lang("invalid_parameter"), $ENV_GOBACK_URL); | |||||
ShowMsg("参数无效", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} | } | ||||
$qstrs = explode('`', $qstr); | $qstrs = explode('`', $qstr); | ||||
@@ -368,29 +393,35 @@ else if ($dopost == "delArchives") { | |||||
$okaids[$aid] = 1; | $okaids[$aid] = 1; | ||||
} | } | ||||
} | } | ||||
ShowMsg(Lang("content_delete_success"), $ENV_GOBACK_URL); | |||||
ShowMsg("成功删除指定文档", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} else { | } else { | ||||
$wintitle = Lang('content_main')."-".Lang('content_action_del'); | |||||
$wecome_info = "<a href='".$ENV_GOBACK_URL."'>".Lang('content_main')."</a>::".Lang('content_action_del'); | |||||
DedeWin::Instance()->Init("archives_do.php", "js/blank.js", "POST")->AddHidden("fmdo", "yes") | |||||
->AddHidden("dopost", $dopost) | |||||
->AddHidden("qstr", $qstr) | |||||
->AddHidden("aid", $aid) | |||||
->AddTitle(Lang('content_confirm_delete',array('qstr'=>$qstr))) | |||||
->GetWindow("ok") | |||||
->Display(); | |||||
$wintitle = "文档管理-删除文档"; | |||||
$wecome_info = "<a href='".$ENV_GOBACK_URL."'>文档管理</a>::删除文档"; | |||||
$win = new OxWindow(); | |||||
$win->Init("archives_do.php", "js/blank.js", "POST"); | |||||
$win->AddHidden("fmdo", "yes"); | |||||
$win->AddHidden("dopost", $dopost); | |||||
$win->AddHidden("qstr", $qstr); | |||||
$win->AddHidden("aid", $aid); | |||||
$win->AddTitle("您确定删除,序号 $qstr 文档"); | |||||
$winform = $win->GetWindow("ok"); | |||||
$win->Display(); | |||||
} | } | ||||
} | } | ||||
/*----------------------------- | |||||
//清空文档 | //清空文档 | ||||
function RbClearArchives(){ } | |||||
------------------------------*/ | |||||
else if ($dopost == 'clear') { | else if ($dopost == 'clear') { | ||||
UserLogin::CheckPurview('a_Del,a_AccDel,a_MyDel,sys_ArcBatch'); | |||||
CheckPurview('a_Del,a_AccDel,a_MyDel,sys_ArcBatch'); | |||||
require_once(DEDEINC."/libraries/oxwindow.class.php"); | |||||
if (empty($fmdo)) $fmdo = ''; | if (empty($fmdo)) $fmdo = ''; | ||||
$recycle = empty($recycle) ? "" : $recycle; | $recycle = empty($recycle) ? "" : $recycle; | ||||
if ($fmdo == 'yes') { | if ($fmdo == 'yes') { | ||||
if (!empty($aid) && empty($qstr)) $qstr = $aid; | if (!empty($aid) && empty($qstr)) $qstr = $aid; | ||||
if ($qstr == '') { | if ($qstr == '') { | ||||
ShowMsg(Lang("invalid_parameter"), "recycling.php"); | |||||
ShowMsg("参数无效", "recycling.php"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$qstrs = explode('`', $qstr); | $qstrs = explode('`', $qstr); | ||||
@@ -403,7 +434,7 @@ else if ($dopost == 'clear') { | |||||
$okaids[$qstr] = 1; | $okaids[$qstr] = 1; | ||||
} | } | ||||
} | } | ||||
ShowMsg(Lang("content_delete_success"), "recycling.php"); | |||||
ShowMsg("成功删除指定文档", "recycling.php"); | |||||
exit(); | exit(); | ||||
} else { | } else { | ||||
$dsql->SetQuery("SELECT id FROM `#@__archives` WHERE `arcrank` = '-2'"); | $dsql->SetQuery("SELECT id FROM `#@__archives` WHERE `arcrank` = '-2'"); | ||||
@@ -415,31 +446,36 @@ else if ($dopost == 'clear') { | |||||
} | } | ||||
$num = $dsql->GetTotalRow(); | $num = $dsql->GetTotalRow(); | ||||
if (empty($num)) { | if (empty($num)) { | ||||
ShowMsg(Lang("content_err_clear_none"), "recycling.php"); | |||||
ShowMsg("对不起,未发现相关文档", "recycling.php"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$wintitle = Lang('content_main')."-".Lang('clear_all'); | |||||
$wecome_info = "<a href='recycling.php'>".Lang('recycling')."</a>::".Lang('clear_all'); | |||||
DedeWin::Instance()->Init("archives_do.php", "js/blank.js", "POST") | |||||
->AddHidden("fmdo", "yes") | |||||
->AddHidden("dopost", $dopost) | |||||
->AddHidden("qstr", $qstr) | |||||
->AddHidden("aid", $aid) | |||||
->AddHidden("recycle", $recycle) | |||||
->AddTitle(Lang('content_err_clear_confirm',array('num'=>$num,'qstr'=>$qstr))) | |||||
->GetWindow("ok") | |||||
->Display(); | |||||
$wintitle = "文档管理-清空所有文档"; | |||||
$wecome_info = "<a href='recycling.php'>文档回收站</a>::清空所有文档"; | |||||
$win = new OxWindow(); | |||||
$win->Init("archives_do.php", "js/blank.js", "POST"); | |||||
$win->AddHidden("fmdo", "yes"); | |||||
$win->AddHidden("dopost", $dopost); | |||||
$win->AddHidden("qstr", $qstr); | |||||
$win->AddHidden("aid", $aid); | |||||
$win->AddHidden("recycle", $recycle); | |||||
$win->AddTitle("回收站将清空 $num 篇文档<br>您确定删除,序号 $qstr 文档"); | |||||
$winform = $win->GetWindow("ok"); | |||||
$win->Display(); | |||||
} | } | ||||
} | } | ||||
/*----------------------------- | |||||
//清除文档 | //清除文档 | ||||
function RbDelArchives(){ } | |||||
------------------------------*/ | |||||
else if ($dopost == 'del') { | else if ($dopost == 'del') { | ||||
UserLogin::CheckPurview('a_Del,a_AccDel,a_MyDel,sys_ArcBatch'); | |||||
CheckPurview('a_Del,a_AccDel,a_MyDel,sys_ArcBatch'); | |||||
require_once(DEDEINC."/libraries/oxwindow.class.php"); | |||||
if (empty($fmdo)) $fmdo = ''; | if (empty($fmdo)) $fmdo = ''; | ||||
$recycle = empty($recycle) ? "" : $recycle; | $recycle = empty($recycle) ? "" : $recycle; | ||||
if ($fmdo == 'yes') { | if ($fmdo == 'yes') { | ||||
if (!empty($aid) && empty($qstr)) $qstr = $aid; | if (!empty($aid) && empty($qstr)) $qstr = $aid; | ||||
if ($qstr == '') { | if ($qstr == '') { | ||||
ShowMsg(Lang("invalid_parameter"), "recycling.php"); | |||||
ShowMsg("参数无效", "recycling.php"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$qstrs = explode('`', $qstr); | $qstrs = explode('`', $qstr); | ||||
@@ -451,49 +487,53 @@ else if ($dopost == 'del') { | |||||
$okaids[$aid] = 1; | $okaids[$aid] = 1; | ||||
} | } | ||||
} | } | ||||
ShowMsg(Lang("content_delete_success"), "recycling.php"); | |||||
ShowMsg("成功删除指定文档", "recycling.php"); | |||||
exit(); | exit(); | ||||
} else { | } else { | ||||
$wintitle = Lang('content_list_main')."-".Lang('content_action_del'); | |||||
$wecome_info = "<a href='recycling.php'>".Lang('content_list_main')."</a>::".Lang('content_action_del'); | |||||
DedeWin::Instance()->Init("archives_do.php", "js/blank.js", "POST") | |||||
->AddHidden("fmdo", "yes") | |||||
->AddHidden("dopost", $dopost) | |||||
->AddHidden("qstr", $qstr) | |||||
->AddHidden("aid", $aid) | |||||
->AddHidden("recycle", $recycle) | |||||
->AddTitle(Lang('content_delete_confirm',array('qstr'=>$qstr))) | |||||
->GetWindow("ok") | |||||
->Display(); | |||||
$wintitle = "文档管理-删除文档"; | |||||
$wecome_info = "<a href='recycling.php'>文档管理</a>::删除文档"; | |||||
$win = new OxWindow(); | |||||
$win->Init("archives_do.php", "js/blank.js", "POST"); | |||||
$win->AddHidden("fmdo", "yes"); | |||||
$win->AddHidden("dopost", $dopost); | |||||
$win->AddHidden("qstr", $qstr); | |||||
$win->AddHidden("aid", $aid); | |||||
$win->AddHidden("recycle", $recycle); | |||||
$win->AddTitle("您确要删除,序号 $qstr 文档"); | |||||
$winform = $win->GetWindow("ok"); | |||||
$win->Display(); | |||||
} | } | ||||
} | } | ||||
/*----------------------------- | |||||
//快速编辑 | //快速编辑 | ||||
function quickEdit(){ } | |||||
------------------------------*/ | |||||
else if ($dopost == 'quickEdit') { | else if ($dopost == 'quickEdit') { | ||||
require_once(DEDEADMIN."/inc/inc_catalog_options.php"); | require_once(DEDEADMIN."/inc/inc_catalog_options.php"); | ||||
AjaxHead(); | AjaxHead(); | ||||
$query = "SELECT ch.typename as channelname,ch.addtable,ar.membername as rankname,arc.* FROM `#@__archives` arc LEFT JOIN `#@__channeltype` ch ON ch.id=arc.channel LEFT JOIN `#@__arcrank` ar ON ar.`rank`=arc.arcrank WHERE arc.id='$aid'"; | |||||
$query = "SELECT ch.typename as channelname,ch.addtable,ar.membername as rankname,arc.* FROM `#@__archives` arc LEFT JOIN `#@__channeltype` ch ON ch.id=arc.channel LEFT JOIN `#@__arcrank` ar ON ar.`rank`=arc.arcrank WHERE arc.id='$aid' "; | |||||
$arcRow = $dsql->GetOne($query); | $arcRow = $dsql->GetOne($query); | ||||
$divname = 'quickEdit'; | $divname = 'quickEdit'; | ||||
echo "<div class='title' onmousemove=\"DropMoveHand('{$divname}', 260);\" onmousedown=\"DropStartHand();\" onmouseup=\"DropStopHand();\">".Lang('catalog_quickedit')."</div>"; | |||||
echo "<div class='title' onmousemove=\"DropMoveHand('{$divname}', 260);\" onmousedown=\"DropStartHand();\" onmouseup=\"DropStopHand();\">快速属性编辑</div>"; | |||||
echo "<form name='quickeditform' action='archives_do.php?dopost=quickEditSave&aid={$aid}' method='post'>"; | echo "<form name='quickeditform' action='archives_do.php?dopost=quickEditSave&aid={$aid}' method='post'>"; | ||||
echo "<input type='hidden' name='addtable' value='{$arcRow['addtable']}'>"; | echo "<input type='hidden' name='addtable' value='{$arcRow['addtable']}'>"; | ||||
echo "<input type='hidden' name='oldtypeid' value='{$arcRow['typeid']}'>"; | echo "<input type='hidden' name='oldtypeid' value='{$arcRow['typeid']}'>"; | ||||
echo "<table width='100%' style='display:inline-block;padding:2px;z-index:9000'>"; | echo "<table width='100%' style='display:inline-block;padding:2px;z-index:9000'>"; | ||||
?> | ?> | ||||
<tr> | <tr> | ||||
<td width="90" class="bline"> <?php echo Lang('catalog_reid');?>:</td> | |||||
<td width="90" class="bline"> 所属栏目:</td> | |||||
<td class="bline"> | <td class="bline"> | ||||
<?php | <?php | ||||
$typeOptions = GetOptionList($arcRow['typeid'], $cUserLogin->getUserChannel(), $arcRow['channel']); | |||||
$typeOptions = GetOptionList($arcRow['typeid'], $cuserLogin->getUserChannel(), $arcRow['channel']); | |||||
echo "<select name='typeid' style='width:320px'>"; | echo "<select name='typeid' style='width:320px'>"; | ||||
if ($arcRow["typeid"] == "0") echo "<option value='0' selected>".Lang('catalog_select')."</option>"; | |||||
if ($arcRow["typeid"] == "0") echo "<option value='0' selected>请选择栏目</option>"; | |||||
echo $typeOptions; | echo $typeOptions; | ||||
echo "</select>"; | echo "</select>"; | ||||
?> | ?> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td width="90" class="bline"> <?php echo Lang('attribute');?>:</td> | |||||
<td width="90" class="bline"> 属性:</td> | |||||
<td class="bline"> | <td class="bline"> | ||||
<input type="hidden" name="oldflag" value="<?php echo $arcRow['flag'];?>"> | <input type="hidden" name="oldflag" value="<?php echo $arcRow['flag'];?>"> | ||||
<?php | <?php | ||||
@@ -510,21 +550,21 @@ else if ($dopost == 'quickEdit') { | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td width="90" class="bline"> <?php echo Lang('title');?>:</td> | |||||
<td width="90" class="bline"> 标题:</td> | |||||
<td class="bline"><input type="text" name="title" id="title" value="<?php echo $arcRow['title'];?>" style="width:320px"></td> | <td class="bline"><input type="text" name="title" id="title" value="<?php echo $arcRow['title'];?>" style="width:320px"></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td width="90" class="bline"> <?php echo Lang('content_short_title');?>:</td> | |||||
<td width="90" class="bline"> 简略标题:</td> | |||||
<td class="bline"><input type="text" name="shorttitle" id="shorttitle" value="<?php echo $arcRow['shorttitle'];?>" style="width:320px"></td> | <td class="bline"><input type="text" name="shorttitle" id="shorttitle" value="<?php echo $arcRow['shorttitle'];?>" style="width:320px"></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td width="90" class="bline"> <?php echo Lang('content_arcrank');?>:</td> | |||||
<td width="90" class="bline"> 阅读权限:</td> | |||||
<td class="bline"> | <td class="bline"> | ||||
<select name="arcrank" id="arcrank" style="width:100px"> | <select name="arcrank" id="arcrank" style="width:100px"> | ||||
<option value='<?php echo $arcRow["arcrank"] ?>'> | <option value='<?php echo $arcRow["arcrank"] ?>'> | ||||
<?php echo $arcRow["rankname"] ?> </option> | <?php echo $arcRow["rankname"] ?> </option> | ||||
<?php | <?php | ||||
$urank = $cUserLogin->getUserRank(); | |||||
$urank = $cuserLogin->getUserRank(); | |||||
$dsql->SetQuery("SELECT * FROM `#@__arcrank` WHERE adminrank<='$urank'"); | $dsql->SetQuery("SELECT * FROM `#@__arcrank` WHERE adminrank<='$urank'"); | ||||
$dsql->Execute(); | $dsql->Execute(); | ||||
while ($row = $dsql->GetObject()) { | while ($row = $dsql->GetObject()) { | ||||
@@ -532,17 +572,17 @@ else if ($dopost == 'quickEdit') { | |||||
} | } | ||||
?> | ?> | ||||
</select> | </select> | ||||
<?php echo Lang('content_money');?>:<input type="text" name="money" id="money" value="<?php echo $arcRow["money"];?>" style="width:100px"> | |||||
需要金币:<input type="text" name="money" id="money" value="<?php echo $arcRow["money"];?>" style="width:100px"> | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td width="90" class="bline"> <?php echo Lang('keywords');?>:</td> | |||||
<td width="90" class="bline"> 关键词:</td> | |||||
<td class="bline"><input type="text" name="keywords" id="keywords" value="<?php echo $arcRow['keywords'];?>" style="width:320px"></td> | <td class="bline"><input type="text" name="keywords" id="keywords" value="<?php echo $arcRow['keywords'];?>" style="width:320px"></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td colspan="2" align="center" class="py-2"> | <td colspan="2" align="center" class="py-2"> | ||||
<button type="submit" class="btn btn-success btn-sm"><?php echo Lang('save');?></button> | |||||
<button type="button" onclick="HideObj('<?php echo $divname;?>');ChangeFullDiv('hide');" class="btn btn-success btn-sm"><?php echo Lang('close');?></button> | |||||
<button type="submit" class="btn btn-success btn-sm">保存</button> | |||||
<button type="button" onclick="HideObj('<?php echo $divname;?>');ChangeFullDiv('hide');" class="btn btn-success btn-sm">关闭</button> | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
@@ -550,60 +590,75 @@ else if ($dopost == 'quickEdit') { | |||||
<?php | <?php | ||||
//AJAX窗体结束 | //AJAX窗体结束 | ||||
} | } | ||||
/*----------------------------- | |||||
//保存快速编辑内容 | //保存快速编辑内容 | ||||
function quickEditSave(){ } | |||||
------------------------------*/ | |||||
else if ($dopost == 'quickEditSave') { | else if ($dopost == 'quickEditSave') { | ||||
require_once(DEDEADMIN.'/inc/inc_archives_functions.php'); | require_once(DEDEADMIN.'/inc/inc_archives_functions.php'); | ||||
//权限检测 | //权限检测 | ||||
if (!UserLogin::TestPurview('a_Edit')) { | |||||
if (UserLogin::TestPurview('a_AccEdit')) { | |||||
UserLogin::CheckCatalog($typeid, Lang('catalog_err_noperm',array('typeid'=>$typeid))); | |||||
if (!TestPurview('a_Edit')) { | |||||
if (TestPurview('a_AccEdit')) { | |||||
CheckCatalog($typeid, "对不起,您没有操作栏目 {$typeid} 文档权限"); | |||||
} else { | } else { | ||||
CheckArcAdmin($aid, $cUserLogin->getUserID()); | |||||
CheckArcAdmin($aid, $cuserLogin->getUserID()); | |||||
} | } | ||||
} | } | ||||
$title = dede_htmlspecialchars(cn_substrR($title, $cfg_title_maxlen)); | $title = dede_htmlspecialchars(cn_substrR($title, $cfg_title_maxlen)); | ||||
$shorttitle = cn_substrR($shorttitle, 36); | $shorttitle = cn_substrR($shorttitle, 36); | ||||
$keywords = trim(cn_substrR($keywords, 60)); | $keywords = trim(cn_substrR($keywords, 60)); | ||||
if (!UserLogin::TestPurview('a_Check,a_AccCheck,a_MyCheck')) $arcrank = -1; | |||||
$adminid = $cUserLogin->getUserID(); | |||||
if (!TestPurview('a_Check,a_AccCheck,a_MyCheck')) $arcrank = -1; | |||||
$adminid = $cuserLogin->getUserID(); | |||||
//属性处理 | //属性处理 | ||||
$flag = isset($flags) ? join(',', $flags) : ''; | $flag = isset($flags) ? join(',', $flags) : ''; | ||||
if (!empty($flag)) { | if (!empty($flag)) { | ||||
if (preg_match("#p#", $oldflag)) $flag .= ',p'; | if (preg_match("#p#", $oldflag)) $flag .= ',p'; | ||||
if (preg_match("#j#", $oldflag)) $flag .= ',j'; | if (preg_match("#j#", $oldflag)) $flag .= ',j'; | ||||
} | } | ||||
$query = "UPDATE `#@__archives` SET typeid = '$typeid',flag='$flag',arcrank='$arcrank',money='$money',title='$title',shorttitle='$shorttitle',keywords='$keywords',dutyadmin='$adminid' WHERE id='$aid';"; | |||||
$query = "UPDATE `#@__archives` SET | |||||
typeid = '$typeid', | |||||
flag = '$flag', | |||||
arcrank = '$arcrank', | |||||
money = '$money', | |||||
title = '$title', | |||||
shorttitle = '$shorttitle', | |||||
keywords = '$keywords', | |||||
dutyadmin = '$adminid' | |||||
WHERE id = '$aid'; "; | |||||
//更新主表 | //更新主表 | ||||
$dsql->ExecuteNoneQuery($query); | $dsql->ExecuteNoneQuery($query); | ||||
//更新微表 | //更新微表 | ||||
$dsql->ExecuteNoneQuery("UPDATE `#@__arctiny` SET typeid='$typeid',arcrank='$arcrank' WHERE id='$aid'"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `#@__arctiny` SET typeid='$typeid',arcrank='$arcrank' WHERE id='$aid' "); | |||||
//更新附加表 | //更新附加表 | ||||
if ($typeid != $oldtypeid) { | if ($typeid != $oldtypeid) { | ||||
$addtable = trim($addtable); | $addtable = trim($addtable); | ||||
if (empty($addtable)) $addtable = '#@__addonarticle'; | if (empty($addtable)) $addtable = '#@__addonarticle'; | ||||
else $addtable = preg_replace("#[^a-z0-9__#@-]#i", "", $addtable); | else $addtable = preg_replace("#[^a-z0-9__#@-]#i", "", $addtable); | ||||
$dsql->ExecuteNoneQuery("UPDATE `$addtable` SET typeid='$typeid' WHERE aid='$aid'"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `$addtable` SET typeid='$typeid' WHERE aid='$aid' "); | |||||
} | } | ||||
//更新网页 | |||||
//更新HTML | |||||
$artUrl = MakeArt($aid, TRUE, TRUE); | $artUrl = MakeArt($aid, TRUE, TRUE); | ||||
$backurl = !empty($_COOKIE['ENV_GOBACK_URL']) ? $_COOKIE['ENV_GOBACK_URL'] : '-1'; | $backurl = !empty($_COOKIE['ENV_GOBACK_URL']) ? $_COOKIE['ENV_GOBACK_URL'] : '-1'; | ||||
ShowMsg(Lang('catalog_success_editquick'), $backurl); | |||||
ShowMsg('成功更新一篇文档基本信息', $backurl); | |||||
exit(); | exit(); | ||||
} | } | ||||
//分析并自动获取文档关键词 | |||||
/*-------------------------- | |||||
分析并自动获取文档关键词 | |||||
function makekw(){ } | |||||
--------------------------*/ | |||||
else if ($dopost == "makekw") { | else if ($dopost == "makekw") { | ||||
UserLogin::CheckPurview('a_Commend,sys_ArcBatch'); | |||||
CheckPurview('a_Commend,sys_ArcBatch'); | |||||
if (!empty($aid) && empty($qstr)) $qstr = $aid; | if (!empty($aid) && empty($qstr)) $qstr = $aid; | ||||
if ($qstr == '') { | if ($qstr == '') { | ||||
ShowMsg(Lang("invalid_parameter"), $ENV_GOBACK_URL); | |||||
ShowMsg("参数无效", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} | } | ||||
$arcids = preg_replace("#[^0-9,]#", '', preg_replace("#`#", ',', $qstr)); | $arcids = preg_replace("#[^0-9,]#", '', preg_replace("#`#", ',', $qstr)); | ||||
$query = "SELECT arc.*, addt.* FROM `#@__archives` arc LEFT JOIN `#@__addonarticle` addt ON addt.aid=arc.id WHERE arc.id in($arcids) AND arc.channel=1"; | |||||
$query = "SELECT arc.*, addt.* From `#@__archives` arc LEFT JOIN `#@__addonarticle` addt ON addt.aid=arc.id WHERE arc.id in($arcids) AND arc.channel=1 "; | |||||
$dsql->SetQuery($query); | $dsql->SetQuery($query); | ||||
$dsql->Execute(); | $dsql->Execute(); | ||||
if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | ||||
$client = new DedeBIZ($cfg_bizcore_hostname, $cfg_bizcore_port); | |||||
$client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port); | |||||
$client->appid = $cfg_bizcore_appid; | $client->appid = $cfg_bizcore_appid; | ||||
$client->key = $cfg_bizcore_key; | $client->key = $cfg_bizcore_key; | ||||
while ($row = $dsql->GetArray()) { | while ($row = $dsql->GetArray()) { | ||||
@@ -623,11 +678,12 @@ else if ($dopost == "makekw") { | |||||
$description = str_replace('关键词', '', $description); | $description = str_replace('关键词', '', $description); | ||||
$description = str_replace('关键词', '', $description); | $description = str_replace('关键词', '', $description); | ||||
$description = addslashes($description); | $description = addslashes($description); | ||||
$dsql->ExecuteNoneQuery("UPDATE `#@__archives` SET `keywords`='$keywords',`description`='$description' WHERE id='{$aid}'"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `#@__archives` SET `keywords`='$keywords',`description`='$description' WHERE id='{$aid}' "); | |||||
} | } | ||||
$client->Close(); | $client->Close(); | ||||
} else { | } else { | ||||
$sp = new SplitWord(); | |||||
include_once(DEDEINC.'/libraries/splitword.class.php'); | |||||
$sp = new SplitWord($cfg_soft_lang, $cfg_soft_lang); | |||||
while ($row = $dsql->GetArray()) { | while ($row = $dsql->GetArray()) { | ||||
//跳过已经有关键词内容 | //跳过已经有关键词内容 | ||||
if (trim($row['keywords']) != '') continue; | if (trim($row['keywords']) != '') continue; | ||||
@@ -636,10 +692,10 @@ else if ($dopost == "makekw") { | |||||
$title = $row['title']; | $title = $row['title']; | ||||
$description = $row['description']; | $description = $row['description']; | ||||
$body = cn_substr($row['body'], 5000); | $body = cn_substr($row['body'], 5000); | ||||
$sp->SetSource($title); | |||||
$sp->SetSource($title, $cfg_soft_lang, $cfg_soft_lang); | |||||
$sp->StartAnalysis(); | $sp->StartAnalysis(); | ||||
$titleindexs = preg_replace("/#p#|#e#/", '', $sp->GetFinallyIndex()); | $titleindexs = preg_replace("/#p#|#e#/", '', $sp->GetFinallyIndex()); | ||||
$sp->SetSource(Html2Text($body)); | |||||
$sp->SetSource(Html2Text($body), $cfg_soft_lang, $cfg_soft_lang); | |||||
$sp->StartAnalysis(); | $sp->StartAnalysis(); | ||||
$allindexs = preg_replace("/#p#|#e#/", '', $sp->GetFinallyIndex()); | $allindexs = preg_replace("/#p#|#e#/", '', $sp->GetFinallyIndex()); | ||||
if (is_array($allindexs) && is_array($titleindexs)) { | if (is_array($allindexs) && is_array($titleindexs)) { | ||||
@@ -667,60 +723,66 @@ else if ($dopost == "makekw") { | |||||
$description = str_replace('关键词', '', $description); | $description = str_replace('关键词', '', $description); | ||||
$description = str_replace('关键词', '', $description); | $description = str_replace('关键词', '', $description); | ||||
$description = addslashes($description); | $description = addslashes($description); | ||||
$dsql->ExecuteNoneQuery("UPDATE `#@__archives` SET `keywords`='$keywords',`description`='$description' WHERE id='{$aid}'"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `#@__archives` SET `keywords`='$keywords',`description`='$description' WHERE id='{$aid}' "); | |||||
} | } | ||||
$sp = null; | $sp = null; | ||||
} | } | ||||
ShowMsg(Lang("content_success_keywords"), $ENV_GOBACK_URL); | |||||
ShowMsg("成功分析指定文档关键词", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} | } | ||||
/*-------------------------- | |||||
//批量增加属性 | //批量增加属性 | ||||
function attsAdd(){ } | |||||
---------------------------*/ | |||||
else if ($dopost == 'attsAdd') { | else if ($dopost == 'attsAdd') { | ||||
UserLogin::CheckPurview('a_Commend,sys_ArcBatch'); | |||||
CheckPurview('a_Commend,sys_ArcBatch'); | |||||
if (!empty($aid) && empty($qstr)) $qstr = $aid; | if (!empty($aid) && empty($qstr)) $qstr = $aid; | ||||
if ($qstr == '') { | if ($qstr == '') { | ||||
ShowMsg(Lang("invalid_parameter"), $ENV_GOBACK_URL); | |||||
ShowMsg("参数无效", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (empty($flagname)) { | if (empty($flagname)) { | ||||
ShowMsg(Lang("content_err_flagname"), $ENV_GOBACK_URL); | |||||
ShowMsg("必须指定要添加属性", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} | } | ||||
$arcids = preg_replace("#[^0-9,]#", '', preg_replace("#`#", ',', $qstr)); | $arcids = preg_replace("#[^0-9,]#", '', preg_replace("#`#", ',', $qstr)); | ||||
$query = "SELECT arc.id,arc.typeid,ch.issystem,ch.maintable,ch.addtable FROM `#@__arctiny` arc LEFT JOIN `#@__arctype` tp ON tp.id=arc.typeid LEFT JOIN `#@__channeltype` ch ON ch.id=tp.channeltype WHERE arc.id in($arcids)"; | |||||
$query = "SELECT arc.id,arc.typeid,ch.issystem,ch.maintable,ch.addtable FROM `#@__arctiny` arc LEFT JOIN `#@__arctype` tp ON tp.id=arc.typeid LEFT JOIN `#@__channeltype` ch ON ch.id=tp.channeltype WHERE arc.id in($arcids) "; | |||||
$dsql->SetQuery($query); | $dsql->SetQuery($query); | ||||
$dsql->Execute(); | $dsql->Execute(); | ||||
while ($row = $dsql->GetArray()) { | while ($row = $dsql->GetArray()) { | ||||
$aid = $row['id']; | $aid = $row['id']; | ||||
if ($row['issystem'] != -1) { | if ($row['issystem'] != -1) { | ||||
$maintable = (trim($row['maintable']) == '' ? '#@__archives' : trim($row['maintable'])); | $maintable = (trim($row['maintable']) == '' ? '#@__archives' : trim($row['maintable'])); | ||||
$arr = $dsql->GetOne("SELECT flag FROM `{$maintable}` WHERE id='$aid'"); | |||||
$arr = $dsql->GetOne("SELECT flag FROM `{$maintable}` WHERE id='$aid' "); | |||||
$flag = ($arr['flag'] == '' ? $flagname : $arr['flag'].','.$flagname); | $flag = ($arr['flag'] == '' ? $flagname : $arr['flag'].','.$flagname); | ||||
$dsql->ExecuteNoneQuery("UPDATE `{$maintable}` SET `flag`='$flag' WHERE id='{$aid}'"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `{$maintable}` SET `flag`='$flag' WHERE id='{$aid}' "); | |||||
} else { | } else { | ||||
$maintable = trim($row['addtable']); | $maintable = trim($row['addtable']); | ||||
$arr = $dsql->GetOne("SELECT flag FROM `{$maintable}` WHERE aid='$aid'"); | |||||
$arr = $dsql->GetOne("SELECT flag FROM `{$maintable}` WHERE aid='$aid' "); | |||||
$flag = ($arr['flag'] == '' ? $flagname : $arr['flag'].','.$flagname); | $flag = ($arr['flag'] == '' ? $flagname : $arr['flag'].','.$flagname); | ||||
$dsql->ExecuteNoneQuery("UPDATE `{$maintable}` SET `flag`='$flag' WHERE aid='{$aid}'"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `{$maintable}` SET `flag`='$flag' WHERE aid='{$aid}' "); | |||||
} | } | ||||
} | } | ||||
ShowMsg(Lang("content_success_attradd"), $ENV_GOBACK_URL); | |||||
ShowMsg("成功对选中文档增加指定属性", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} | } | ||||
/*-------------------------- | |||||
//批量删除属性 | //批量删除属性 | ||||
function attsDel(){ } | |||||
---------------------------*/ | |||||
else if ($dopost == 'attsDel') { | else if ($dopost == 'attsDel') { | ||||
UserLogin::CheckPurview('a_Commend,sys_ArcBatch'); | |||||
CheckPurview('a_Commend,sys_ArcBatch'); | |||||
if (!empty($aid) && empty($qstr)) $qstr = $aid; | if (!empty($aid) && empty($qstr)) $qstr = $aid; | ||||
if ($qstr == '') { | if ($qstr == '') { | ||||
ShowMsg(Lang("invalid_parameter"), $ENV_GOBACK_URL); | |||||
ShowMsg("参数无效", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (empty($flagname)) { | if (empty($flagname)) { | ||||
ShowMsg(Lang("content_err_flagname_del"), $ENV_GOBACK_URL); | |||||
ShowMsg("必须指定要删除属性", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} | } | ||||
$arcids = preg_replace("#[^0-9,]#", '', preg_replace("#`#", ',', $qstr)); | $arcids = preg_replace("#[^0-9,]#", '', preg_replace("#`#", ',', $qstr)); | ||||
$query = "SELECT arc.id,arc.typeid,ch.issystem,ch.maintable,ch.addtable FROM `#@__arctiny` arc LEFT JOIN `#@__arctype` tp ON tp.id=arc.typeid LEFT JOIN `#@__channeltype` ch ON ch.id=tp.channeltype WHERE arc.id in($arcids)"; | |||||
$query = "SELECT arc.id,arc.typeid,ch.issystem,ch.maintable,ch.addtable FROM `#@__arctiny` arc LEFT JOIN `#@__arctype` tp ON tp.id=arc.typeid LEFT JOIN `#@__channeltype` ch ON ch.id=tp.channeltype WHERE arc.id in($arcids) "; | |||||
$dsql->SetQuery($query); | $dsql->SetQuery($query); | ||||
$dsql->Execute(); | $dsql->Execute(); | ||||
while ($row = $dsql->GetArray()) { | while ($row = $dsql->GetArray()) { | ||||
@@ -728,11 +790,11 @@ else if ($dopost == 'attsDel') { | |||||
if ($row['issystem'] != -1) { | if ($row['issystem'] != -1) { | ||||
$idname = 'id'; | $idname = 'id'; | ||||
$maintable = (trim($row['maintable']) == '' ? '#@__archives' : trim($row['maintable'])); | $maintable = (trim($row['maintable']) == '' ? '#@__archives' : trim($row['maintable'])); | ||||
$arr = $dsql->GetOne("SELECT flag FROM `{$maintable}` WHERE id='$aid'"); | |||||
$arr = $dsql->GetOne("SELECT flag FROM `{$maintable}` WHERE id='$aid' "); | |||||
} else { | } else { | ||||
$idname = 'aid'; | $idname = 'aid'; | ||||
$maintable = trim($row['addtable']); | $maintable = trim($row['addtable']); | ||||
$arr = $dsql->GetOne("SELECT flag FROM `{$maintable}` WHERE aid='$aid'"); | |||||
$arr = $dsql->GetOne("SELECT flag FROM `{$maintable}` WHERE aid='$aid' "); | |||||
} | } | ||||
$flag = $arr['flag']; | $flag = $arr['flag']; | ||||
if (trim($flag) == '' || !preg_match("#".$flagname."#", $flag)) { | if (trim($flag) == '' || !preg_match("#".$flagname."#", $flag)) { | ||||
@@ -745,15 +807,18 @@ else if ($dopost == 'attsDel') { | |||||
} | } | ||||
} | } | ||||
$flag = trim(join(',', $okflags)); | $flag = trim(join(',', $okflags)); | ||||
$dsql->ExecuteNoneQuery("UPDATE `{$maintable}` SET `flag`='$flag' WHERE {$idname}='{$aid}'"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `{$maintable}` SET `flag`='$flag' WHERE {$idname}='{$aid}' "); | |||||
} | } | ||||
ShowMsg(Lang("content_success_attrdel"), $ENV_GOBACK_URL); | |||||
ShowMsg("成功对选中文档删除指定属性", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} | } | ||||
/*-------------------------- | |||||
//获得批量属性处理AJAX窗体 | //获得批量属性处理AJAX窗体 | ||||
function attsDlg(){ } | |||||
---------------------------*/ | |||||
else if ($dopost == 'attsDlg') { | else if ($dopost == 'attsDlg') { | ||||
if (!empty($aid) && empty($qstr)) $qstr = $aid; | if (!empty($aid) && empty($qstr)) $qstr = $aid; | ||||
$dojobname = ($dojob == 'attsDel' ? Lang('content_atts_dlg') : Lang('content_atts_adlg')); | |||||
$dojobname = ($dojob == 'attsDel' ? '批量删除属性' : '批量增加属性'); | |||||
AjaxHead(); | AjaxHead(); | ||||
//输出AJAX可移动窗体 | //输出AJAX可移动窗体 | ||||
$divname = 'attsDlg'; | $divname = 'attsDlg'; | ||||
@@ -764,7 +829,7 @@ else if ($dopost == 'attsDlg') { | |||||
echo "<table width='100%' style='display:inline-block;padding:2px;z-index:9000'>"; | echo "<table width='100%' style='display:inline-block;padding:2px;z-index:9000'>"; | ||||
?> | ?> | ||||
<tr> | <tr> | ||||
<td width="90" class="bline"> <?php echo Lang('attribute');?>:</td> | |||||
<td width="90" class="bline"> 属性:</td> | |||||
<td class="bline"> | <td class="bline"> | ||||
<input type="hidden" name="oldflag" value="<?php echo $arcRow['flag'];?>"> | <input type="hidden" name="oldflag" value="<?php echo $arcRow['flag'];?>"> | ||||
<?php | <?php | ||||
@@ -778,13 +843,13 @@ else if ($dopost == 'attsDlg') { | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td width="90" class="bline"> <?php echo Lang('freelist_orderby_id');?>:</td> | |||||
<td width="90" class="bline"> 文档id:</td> | |||||
<td class="bline"><input type="text" name="tmpids" value="<?php echo $qstr;?>" style="width:320px;overflow:hidden"></td> | <td class="bline"><input type="text" name="tmpids" value="<?php echo $qstr;?>" style="width:320px;overflow:hidden"></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td colspan="2" align="center" class="py-2"> | <td colspan="2" align="center" class="py-2"> | ||||
<button type="submit" class="btn btn-success btn-sm"><?php echo Lang('save');?></button> | |||||
<button type="button" onclick="HideObj('<?php echo $divname;?>');ChangeFullDiv('hide');" class="btn btn-success btn-sm"><?php echo Lang('close');?></button> | |||||
<button type="submit" class="btn btn-success btn-sm">保存</button> | |||||
<button type="button" onclick="HideObj('<?php echo $divname;?>');ChangeFullDiv('hide');" class="btn btn-success btn-sm">关闭</button> | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
@@ -792,18 +857,22 @@ else if ($dopost == 'attsDlg') { | |||||
<?php | <?php | ||||
//AJAX窗体结束 | //AJAX窗体结束 | ||||
} | } | ||||
/*------------------------ | |||||
function getCatMap() { } | |||||
-------------------------*/ | |||||
else if ($dopost == 'getCatMap') { | else if ($dopost == 'getCatMap') { | ||||
require_once(DEDEINC.'/typelink/typeunit.class.selector.php'); | |||||
AjaxHead(); | AjaxHead(); | ||||
//输出AJAX可移动窗体 | //输出AJAX可移动窗体 | ||||
$divname = 'getCatMap'; | $divname = 'getCatMap'; | ||||
echo "<div class='title' style='cursor:default'>".Lang('catalog_quicksel')."</div>"; | |||||
echo "<div class='title' style='cursor:default'>栏目快速选择器</div>"; | |||||
$tus = new TypeUnitSelector(); | $tus = new TypeUnitSelector(); | ||||
?> | ?> | ||||
<form name="quicksel" action="javascript:;" method="get"> | <form name="quicksel" action="javascript:;" method="get"> | ||||
<div class="quicksel"><?php $tus->ListAllType($channelid);?></div> | <div class="quicksel"><?php $tus->ListAllType($channelid);?></div> | ||||
<div align="center" class="quickselfoot"> | <div align="center" class="quickselfoot"> | ||||
<button onclick="getSelCat('<?php echo $targetid;?>');" class="btn btn-success btn-sm"><?php echo Lang('save');?></button> | |||||
<button type="button" onclick="HideObj('<?php echo $divname;?>');ChangeFullDiv('hide');" class="btn btn-success btn-sm"><?php echo Lang('close');?></button> | |||||
<button onclick="getSelCat('<?php echo $targetid;?>');" class="btn btn-success btn-sm">保存</button> | |||||
<button type="button" onclick="HideObj('<?php echo $divname;?>');ChangeFullDiv('hide');" class="btn btn-success btn-sm">关闭</button> | |||||
</div> | </div> | ||||
</form> | </form> | ||||
<?php | <?php | ||||
@@ -8,27 +8,27 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DedeWin; | |||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('a_Edit,a_AccEdit,a_MyEdit'); | |||||
CheckPurview('a_Edit,a_AccEdit,a_MyEdit'); | |||||
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"); | ||||
UserLogin::ClearMyAddon(); | |||||
require_once(DEDEINC."/dedetag.class.php"); | |||||
ClearMyAddon(); | |||||
$aid = intval($aid); | $aid = intval($aid); | ||||
//读取归档信息 | //读取归档信息 | ||||
$arcQuery = "SELECT ch.typename as channelname,ar.membername as rankname,arc.* FROM `#@__archives` arc LEFT JOIN `#@__channeltype` ch ON ch.id=arc.channel LEFT JOIN `#@__arcrank` ar ON ar.`rank`=arc.arcrank WHERE arc.id='$aid'"; | $arcQuery = "SELECT ch.typename as channelname,ar.membername as rankname,arc.* FROM `#@__archives` arc LEFT JOIN `#@__channeltype` ch ON ch.id=arc.channel 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(Lang("content_err_archive"), "-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(Lang("content_err_channel"), "javascript:;"); | |||||
ShowMsg("读取频道配置信息出错!", "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$addtable = $cInfos['addtable']; | $addtable = $cInfos['addtable']; | ||||
@@ -38,8 +38,12 @@ if ($dopost != 'save') { | |||||
include DedeInclude("templets/archives_edit.htm"); | include DedeInclude("templets/archives_edit.htm"); | ||||
exit(); | exit(); | ||||
} | } | ||||
/*-------------------------------- | |||||
function __save(){ } | |||||
-------------------------------*/ | |||||
else if ($dopost == 'save') { | else if ($dopost == 'save') { | ||||
helper('image'); | |||||
require_once(DEDEINC.'/image.func.php'); | |||||
require_once(DEDEINC.'/libraries/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; | ||||
@@ -49,22 +53,22 @@ else if ($dopost == 'save') { | |||||
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(Lang('content_error_typeid_isempty'), "-1"); | |||||
ShowMsg("请指定文档的栏目", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (empty($channelid)) { | if (empty($channelid)) { | ||||
ShowMsg(Lang('content_error_channelid_isempty'), "-1"); | |||||
ShowMsg("文档为非指定的类型,请检查您发布内容的表单是否合法", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (!CheckChannel($typeid, $channelid)) { | if (!CheckChannel($typeid, $channelid)) { | ||||
ShowMsg(Lang('content_error_channelid_check_failed'), "-1"); | |||||
ShowMsg("您所选择的栏目与当前模型不相符,请选择白色的选项", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (!UserLogin::TestPurview('a_Edit')) { | |||||
if (UserLogin::TestPurview('a_AccEdit')) { | |||||
UserLogin::CheckCatalog($typeid, Lang('content_error_channelid_check_failed',array('typeid'=>$typeid))); | |||||
if (!TestPurview('a_Edit')) { | |||||
if (TestPurview('a_AccEdit')) { | |||||
CheckCatalog($typeid, "对不起,您没有操作栏目 {$typeid} 的文档权限"); | |||||
} else { | } else { | ||||
CheckArcAdmin($id, $cUserLogin->getUserID()); | |||||
CheckArcAdmin($id, $cuserLogin->getUserID()); | |||||
} | } | ||||
} | } | ||||
//对保存的内容进行处理 | //对保存的内容进行处理 | ||||
@@ -79,9 +83,10 @@ else if ($dopost == 'save') { | |||||
$description = cn_substrR($description, $cfg_auot_description); | $description = cn_substrR($description, $cfg_auot_description); | ||||
$keywords = trim(cn_substrR($keywords, 60)); | $keywords = trim(cn_substrR($keywords, 60)); | ||||
$filename = trim(cn_substrR($filename, 40)); | $filename = trim(cn_substrR($filename, 40)); | ||||
$isremote = 0; | |||||
$serviterm = empty($serviterm) ? "" : $serviterm; | $serviterm = empty($serviterm) ? "" : $serviterm; | ||||
if (!UserLogin::TestPurview('a_Check,a_AccCheck,a_MyCheck')) $arcrank = -1; | |||||
$adminid = $cUserLogin->getUserID(); | |||||
if (!TestPurview('a_Check,a_AccCheck,a_MyCheck')) $arcrank = -1; | |||||
$adminid = $cuserLogin->getUserID(); | |||||
//处理上传的缩略图 | //处理上传的缩略图 | ||||
if (empty($ddisremote)) $ddisremote = 0; | if (empty($ddisremote)) $ddisremote = 0; | ||||
$litpic = GetDDImage('none', $picname, $ddisremote); | $litpic = GetDDImage('none', $picname, $ddisremote); | ||||
@@ -98,7 +103,7 @@ else if ($dopost == 'save') { | |||||
continue; | continue; | ||||
} | } | ||||
$vs = explode(',', $v); | $vs = explode(',', $v); | ||||
if ($vs[1] == 'htmltext' || $vs[1] == 'textdata') //网页文本特殊处理 | |||||
if ($vs[1] == 'htmltext' || $vs[1] == 'textdata') //HTML文本特殊处理 | |||||
{ | { | ||||
${$vs[0]} = AnalyseHtmlBody(${$vs[0]}, $description, $litpic, $keywords, $vs[1]); | ${$vs[0]} = AnalyseHtmlBody(${$vs[0]}, $description, $litpic, $keywords, $vs[1]); | ||||
} else { | } else { | ||||
@@ -121,65 +126,47 @@ else if ($dopost == 'save') { | |||||
//跳转网址的文档强制为动态 | //跳转网址的文档强制为动态 | ||||
if (preg_match("#j#", $flag)) $ismake = -1; | if (preg_match("#j#", $flag)) $ismake = -1; | ||||
//更新数据库的SQL语句 | //更新数据库的SQL语句 | ||||
$inQuery = "UPDATE `#@__archives` SET | |||||
typeid='$typeid', | |||||
typeid2='$typeid2', | |||||
sortrank='$sortrank', | |||||
flag='$flag', | |||||
notpost='$notpost', | |||||
click='$click', | |||||
ismake='$ismake', | |||||
arcrank='$arcrank', | |||||
money='$money', | |||||
title='$title', | |||||
color='$color', | |||||
writer='$writer', | |||||
source='$source', | |||||
litpic='$litpic', | |||||
pubdate='$pubdate', | |||||
DESCription='$description', | |||||
keywords='$keywords', | |||||
shorttitle='$shorttitle', | |||||
filename='$filename', | |||||
dutyadmin='$adminid', | |||||
weight='$weight' | |||||
WHERE id='$id'; "; | |||||
$inQuery = "UPDATE `#@__archives` SET typeid='$typeid',typeid2='$typeid2',sortrank='$sortrank',flag='$flag',notpost='$notpost',click='$click',ismake='$ismake',arcrank='$arcrank',money='$money',title='$title',color='$color',writer='$writer',source='$source',litpic='$litpic',pubdate='$pubdate',description='$description',keywords='$keywords',shorttitle='$shorttitle',filename='$filename',dutyadmin='$adminid',weight='$weight' WHERE id='$id'; "; | |||||
if (!$dsql->ExecuteNoneQuery($inQuery)) { | if (!$dsql->ExecuteNoneQuery($inQuery)) { | ||||
ShowMsg(Lang('content_err_update_archive'), "-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(Lang('content_err_update_addon',array('addtable'=>$addtable)), "javascript:;"); | |||||
ShowMsg("更新附加表 `$addtable` 时出错,请检查原因", "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
} | } | ||||
//生成网页 | //生成网页 | ||||
UpIndexKey($id, $arcrank, $typeid, $sortrank, $tags); | UpIndexKey($id, $arcrank, $typeid, $sortrank, $tags); | ||||
$artUrl = MakeArt($id, TRUE, TRUE); | |||||
$artUrl = MakeArt($id, TRUE, TRUE, $isremote); | |||||
if ($artUrl == '') { | if ($artUrl == '') { | ||||
$artUrl = $cfg_phpurl."/view.php?aid=$id"; | $artUrl = $cfg_phpurl."/view.php?aid=$id"; | ||||
} | } | ||||
UserLogin::ClearMyAddon($id, $title); | |||||
ClearMyAddon($id, $title); | |||||
//自动更新关联内容 | //自动更新关联内容 | ||||
if (isset($automake) && 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})) { | ||||
$ids = explode(",", ${$key}); | $ids = explode(",", ${$key}); | ||||
foreach ($ids as $id) { | foreach ($ids as $id) { | ||||
MakeArt($id, true, true); | |||||
MakeArt($id, true, true, $isremote); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
//返回成功信息 | //返回成功信息 | ||||
$msg = Lang('more_actions').":<a href='archives_add.php?cid=$typeid' class='btn btn-success btn-sm'>".Lang('content_continue_publish')."</a><a href='archives_do.php?aid=".$id."&dopost=editArchives' class='btn btn-success btn-sm'>".Lang('content_edit')."</a><a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>".Lang('content_view')."</a><a href='catalog_do.php?cid=$typeid&dopost=listArchives' class='btn btn-success btn-sm'>".Lang('content_published_main')."</a>$backurl"; | |||||
$wintitle = Lang("content_success_edit"); | |||||
$wecome_info = Lang('content_main')."::".Lang('content_edit'); | |||||
DedeWin::Instance()->AddTitle(Lang("content_success_edit").":")->AddMsgItem($msg)->GetWindow("hand", " ", false)->Display(); | |||||
$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 = "文档管理::修改商品"; | |||||
$win = new OxWindow(); | |||||
$win->AddTitle("成功修改商品:"); | |||||
$win->AddMsgItem($msg); | |||||
$winform = $win->GetWindow("hand", " ", false); | |||||
$win->Display(); | |||||
} | } | ||||
?> | ?> |
@@ -8,67 +8,72 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DedeWin; | |||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('a_New,a_AccNew'); | |||||
CheckPurview('a_New,a_AccNew'); | |||||
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(DEDEADMIN."/inc/inc_catalog_options.php"); | require_once(DEDEADMIN."/inc/inc_catalog_options.php"); | ||||
UserLogin::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(Lang('content_err_channel_empty'), "-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']; | ||||
include DedeInclude("templets/archives_sg_add.htm"); | include DedeInclude("templets/archives_sg_add.htm"); | ||||
exit(); | exit(); | ||||
} | } | ||||
/*-------------------------------- | |||||
function __save(){ } | |||||
-------------------------------*/ | |||||
else if ($dopost == 'save') { | else if ($dopost == 'save') { | ||||
helper('image'); | |||||
require_once(DEDEINC.'/image.func.php'); | |||||
require_once(DEDEINC.'/libraries/oxwindow.class.php'); | |||||
if ($typeid == 0) { | if ($typeid == 0) { | ||||
ShowMsg(Lang('content_error_typeid_isempty'), "-1"); | |||||
ShowMsg("请指定文档的栏目", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (empty($channelid)) { | if (empty($channelid)) { | ||||
ShowMsg(Lang('content_error_channelid_isempty'), "-1"); | |||||
ShowMsg("文档为非指定的类型,请检查您发布内容的表单是否合法", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (!CheckChannel($typeid, $channelid)) { | if (!CheckChannel($typeid, $channelid)) { | ||||
ShowMsg(Lang('content_error_channelid_check_failed'), "-1"); | |||||
ShowMsg("您所选择的栏目与当前模型不相符,请选择白色的选项", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (!UserLogin::TestPurview('a_New')) { | |||||
UserLogin::CheckCatalog($typeid, Lang('content_error_channelid_check_failed',array('typeid'=>$typeid))); | |||||
if (!TestPurview('a_New')) { | |||||
CheckCatalog($typeid, "对不起,您没有操作栏目 {$typeid} 的权限"); | |||||
} | } | ||||
//对保存的内容进行处理 | //对保存的内容进行处理 | ||||
if (empty($writer)) $writer = $cUserLogin->getUserName(); | |||||
if (empty($source)) $source = Lang('unknow'); | |||||
if (empty($writer)) $writer = $cuserLogin->getUserName(); | |||||
if (empty($source)) $source = '未知'; | |||||
if (empty($flags)) $flag = ''; | if (empty($flags)) $flag = ''; | ||||
else $flag = join(',', $flags); | else $flag = join(',', $flags); | ||||
$senddate = time(); | $senddate = time(); | ||||
$title = cn_substrR($title, $cfg_title_maxlen); | $title = cn_substrR($title, $cfg_title_maxlen); | ||||
$isremote = 0; | |||||
$serviterm = empty($serviterm) ? "" : $serviterm; | $serviterm = empty($serviterm) ? "" : $serviterm; | ||||
if (!UserLogin::TestPurview('a_Check,a_AccCheck,a_MyCheck')) $arcrank = -1; | |||||
$adminid = $cUserLogin->getUserID(); | |||||
if (!TestPurview('a_Check,a_AccCheck,a_MyCheck')) $arcrank = -1; | |||||
$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); | ||||
//生成文档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(Lang("content_error_id_is_empty"), "-1"); | |||||
ShowMsg("无法获得主键,因此无法进行后续操作", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
//分析处理附加表数据 | //分析处理附加表数据 | ||||
@@ -84,7 +89,7 @@ else if ($dopost == 'save') { | |||||
continue; | continue; | ||||
} | } | ||||
$vs = explode(',', $v); | $vs = explode(',', $v); | ||||
if ($vs[1] == 'htmltext' || $vs[1] == 'textdata') //网页文本特殊处理 | |||||
if ($vs[1] == 'htmltext' || $vs[1] == 'textdata') //HTML文本特殊处理 | |||||
{ | { | ||||
${$vs[0]} = AnalyseHtmlBody(${$vs[0]}, $description, $litpic, $keywords, $vs[1]); | ${$vs[0]} = AnalyseHtmlBody(${$vs[0]}, $description, $litpic, $keywords, $vs[1]); | ||||
} else { | } else { | ||||
@@ -103,27 +108,31 @@ else if ($dopost == 'save') { | |||||
$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}) VALUES ('$arcID','$typeid','$channelid','$arcrank','$adminid','0','$title','$senddate','$flag','$litpic','$userip'{$inadd_v})"; | |||||
$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})"; | |||||
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(Lang('content_error_addtable_save',array('addtable'=>$addtable, 'error'=>str_replace('"', '', $gerr))), "javascript:;"); | |||||
ShowMsg("把数据保存到数据库附加表 `{$addtable}` 时出错,请把相关信息提交给DedeBIZ官方".str_replace('"', '', $gerr), "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
} | } | ||||
//生成网页 | //生成网页 | ||||
$artUrl = MakeArt($arcID, TRUE, TRUE); | |||||
$artUrl = MakeArt($arcID, TRUE, TRUE, $isremote); | |||||
if ($artUrl == '') { | if ($artUrl == '') { | ||||
$artUrl = $cfg_phpurl."/view.php?aid=$arcID"; | $artUrl = $cfg_phpurl."/view.php?aid=$arcID"; | ||||
} | } | ||||
UserLogin::ClearMyAddon($arcID, $title); | |||||
ClearMyAddon($arcID, $title); | |||||
//返回成功信息 | //返回成功信息 | ||||
$msg = Lang('more_actions').":<a href='archives_sg_add.php?cid=$typeid' class='btn btn-success btn-sm'>".Lang('content_continue_publish')."</a><a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>".Lang('content_view')."</a><a href='archives_do.php?aid=".$arcID."&dopost=editArchives' class='btn btn-success btn-sm'>".Lang('content_edit')."</a><a href='content_sg_list.php?cid=$typeid&channelid={$channelid}&dopost=listArchives' class='btn btn-success btn-sm'>".Lang('content_published_main')."</a><a href='catalog_main.php' class='btn btn-success btn-sm'>".Lang('catalog_main')."</a>"; | |||||
$wintitle = Lang("content_success_publish"); | |||||
$wecome_info = Lang('content_main')."::".Lang('content_add'); | |||||
DedeWin::Instance()->AddTitle(Lang("content_success_publish").":")->AddMsgItem($msg)->GetWindow("hand", " ", false)->Display(); | |||||
$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 = "文档管理::发布分类"; | |||||
$win = new OxWindow(); | |||||
$win->AddTitle("成功发布分类:"); | |||||
$win->AddMsgItem($msg); | |||||
$winform = $win->GetWindow("hand", " ", false); | |||||
$win->Display(); | |||||
} | } | ||||
?> | ?> |
@@ -8,21 +8,21 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DedeWin; | |||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('a_Edit,a_AccEdit,a_MyEdit'); | |||||
CheckPurview('a_Edit,a_AccEdit,a_MyEdit'); | |||||
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"); | ||||
UserLogin::ClearMyAddon(); | |||||
require_once(DEDEINC."/dedetag.class.php"); | |||||
ClearMyAddon(); | |||||
$aid = intval($aid); | $aid = intval($aid); | ||||
//读取归档信息 | //读取归档信息 | ||||
$arcQuery = "SELECT ch.*,arc.* FROM `#@__arctiny` arc LEFT JOIN `#@__channeltype` ch on ch.id=arc.channel WHERE arc.id='$aid'"; | |||||
$arcQuery = "SELECT ch.*,arc.* FROM `#@__arctiny` arc 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(Lang("content_err_channel"), "-1"); | |||||
ShowMsg("读频道模型信息出错", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$addtable = $cInfos['addtable']; | $addtable = $cInfos['addtable']; | ||||
@@ -32,34 +32,39 @@ if ($dopost != 'save') { | |||||
include DedeInclude('templets/archives_sg_edit.htm'); | include DedeInclude('templets/archives_sg_edit.htm'); | ||||
exit(); | exit(); | ||||
} | } | ||||
/*-------------------------------- | |||||
function __save(){ } | |||||
-------------------------------*/ | |||||
else if ($dopost == 'save') { | else if ($dopost == 'save') { | ||||
helper('image'); | |||||
require_once(DEDEINC.'/image.func.php'); | |||||
require_once(DEDEINC.'/libraries/oxwindow.class.php'); | |||||
if ($typeid == 0) { | if ($typeid == 0) { | ||||
ShowMsg(Lang('content_error_typeid_isempty'), "-1"); | |||||
ShowMsg("请指定文档的栏目", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (empty($channelid)) { | if (empty($channelid)) { | ||||
ShowMsg(Lang('content_error_channelid_isempty'), "-1"); | |||||
ShowMsg("文档为非指定的类型,请检查您发布内容的表单是否合法", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (!CheckChannel($typeid, $channelid)) { | if (!CheckChannel($typeid, $channelid)) { | ||||
ShowMsg(Lang('content_error_channelid_check_failed'), "-1"); | |||||
ShowMsg("您所选择的栏目与当前模型不相符,请选择白色的选项", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (!UserLogin::TestPurview('a_Edit')) { | |||||
if (UserLogin::TestPurview('a_AccEdit')) { | |||||
UserLogin::CheckCatalog($typeid, Lang('content_error_channelid_check_failed',array('typeid'=>$typeid))); | |||||
if (!TestPurview('a_Edit')) { | |||||
if (TestPurview('a_AccEdit')) { | |||||
CheckCatalog($typeid, "对不起,您没有操作栏目 {$typeid} 的文档权限"); | |||||
} else { | } else { | ||||
CheckArcAdmin($id, $cUserLogin->getUserID()); | |||||
CheckArcAdmin($id, $cuserLogin->getUserID()); | |||||
} | } | ||||
} | } | ||||
//对保存的内容进行处理 | //对保存的内容进行处理 | ||||
if (empty($flags)) $flag = ''; | if (empty($flags)) $flag = ''; | ||||
else $flag = join(',', $flags); | else $flag = join(',', $flags); | ||||
$title = cn_substrR($title, $cfg_title_maxlen); | $title = cn_substrR($title, $cfg_title_maxlen); | ||||
$isremote = 0; | |||||
$serviterm = empty($serviterm) ? "" : $serviterm; | $serviterm = empty($serviterm) ? "" : $serviterm; | ||||
if (!UserLogin::TestPurview('a_Check,a_AccCheck,a_MyCheck')) $arcrank = -1; | |||||
$adminid = $cUserLogin->getUserID(); | |||||
if (!TestPurview('a_Check,a_AccCheck,a_MyCheck')) $arcrank = -1; | |||||
$adminid = $cuserLogin->getUserID(); | |||||
//处理上传的缩略图 | //处理上传的缩略图 | ||||
if (empty($ddisremote)) $ddisremote = 0; | if (empty($ddisremote)) $ddisremote = 0; | ||||
$litpic = GetDDImage('none', $picname, $ddisremote); | $litpic = GetDDImage('none', $picname, $ddisremote); | ||||
@@ -76,7 +81,7 @@ else if ($dopost == 'save') { | |||||
continue; | continue; | ||||
} | } | ||||
$vs = explode(',', $v); | $vs = explode(',', $v); | ||||
if ($vs[1] == 'htmltext' || $vs[1] == 'textdata') //网页文本特殊处理 | |||||
if ($vs[1] == 'htmltext' || $vs[1] == 'textdata') //HTML文本特殊处理 | |||||
{ | { | ||||
${$vs[0]} = AnalyseHtmlBody(${$vs[0]}, $description, $litpic, $keywords, $vs[1]); | ${$vs[0]} = AnalyseHtmlBody(${$vs[0]}, $description, $litpic, $keywords, $vs[1]); | ||||
} else { | } else { | ||||
@@ -93,24 +98,28 @@ else if ($dopost == '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(Lang('content_err_update_addon',array('addtable'=>$addtable)), "javascript:;"); | |||||
ShowMsg("更新附加表 `$addtable` 时出错,请检查原因", "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
} | } | ||||
//生成网页 | //生成网页 | ||||
UpIndexKey($id, $arcrank, $typeid, $sortrank, ''); | UpIndexKey($id, $arcrank, $typeid, $sortrank, ''); | ||||
$artUrl = MakeArt($id, TRUE, TRUE); | |||||
$artUrl = MakeArt($id, TRUE, TRUE, $isremote); | |||||
if ($artUrl == '') $artUrl = $cfg_phpurl."/view.php?aid=$id"; | if ($artUrl == '') $artUrl = $cfg_phpurl."/view.php?aid=$id"; | ||||
UserLogin::ClearMyAddon($id, $title); | |||||
ClearMyAddon($id, $title); | |||||
//返回成功信息 | //返回成功信息 | ||||
$msg = Lang('more_actions').":<a href='archives_sg_add.php?cid=$typeid' class='btn btn-success btn-sm'>".Lang('content_continue_publish')."</a><a href='archives_do.php?aid=".$id."&dopost=editArchives' class='btn btn-success btn-sm'>".Lang('content_view')."</a><a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>".Lang('content_edit')."</a><a href='catalog_do.php?cid=$typeid&channelid={$channelid}&dopost=listArchives' class='btn btn-success btn-sm'>".Lang('content_published_main')."</a><a href='catalog_main.php' class='btn btn-success btn-sm'>".Lang('catalog_main')."</a>"; | |||||
$wintitle = Lang("content_success_edit"); | |||||
$wecome_info = Lang('content_main')."::".Lang('content_edit'); | |||||
DedeWin::Instance()->AddTitle(Lang("content_success_edit").":")->AddMsgItem($msg)->GetWindow("hand", " ", false)->Display(); | |||||
$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 = "文档管理::修改分类"; | |||||
$win = new OxWindow(); | |||||
$win->AddTitle("成功修改分类:"); | |||||
$win->AddMsgItem($msg); | |||||
$winform = $win->GetWindow("hand", " ", false); | |||||
$win->Display(); | |||||
} | } | ||||
?> | ?> |
@@ -8,18 +8,18 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DedeWin; | |||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__).'/config.php'); | require_once(dirname(__FILE__).'/config.php'); | ||||
UserLogin::CheckPurview('a_New,a_AccNew'); | |||||
CheckPurview('a_New,a_AccNew'); | |||||
require_once(DEDEINC.'/customfields.func.php'); | |||||
require_once(DEDEADMIN.'/inc/inc_archives_functions.php'); | require_once(DEDEADMIN.'/inc/inc_archives_functions.php'); | ||||
if (file_exists(DEDEDATA.'/template.rand.php')) { | 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(DEDEADMIN."/inc/inc_catalog_options.php"); | require_once(DEDEADMIN."/inc/inc_catalog_options.php"); | ||||
UserLogin::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); | ||||
if (empty($geturl)) $geturl = ''; | if (empty($geturl)) $geturl = ''; | ||||
@@ -30,9 +30,9 @@ if ($dopost != 'save') { | |||||
$redatas = CoOnePage($geturl); | $redatas = CoOnePage($geturl); | ||||
extract((array)$redatas); | extract((array)$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'; "); | |||||
$channelid = $row['channeltype']; | $channelid = $row['channeltype']; | ||||
} else { | } else { | ||||
if ($channelid == 0) { | if ($channelid == 0) { | ||||
@@ -40,15 +40,19 @@ if ($dopost != 'save') { | |||||
} | } | ||||
} | } | ||||
//获得频道模型信息 | //获得频道模型信息 | ||||
$cInfos = $dsql->GetOne("SELECT * FROM `#@__channeltype` WHERE id='$channelid'"); | |||||
$cInfos = $dsql->GetOne("SELECT * From `#@__channeltype` where id='$channelid' "); | |||||
//获取文档最大id+1以确定当前权重 | //获取文档最大id+1以确定当前权重 | ||||
$maxWright = $dsql->GetOne("SELECT id+1 AS cc FROM `#@__archives` ORDER BY id DESC LIMIT 1"); | $maxWright = $dsql->GetOne("SELECT id+1 AS cc FROM `#@__archives` ORDER BY id DESC LIMIT 1"); | ||||
$maxWright = empty($maxWright)? array('cc'=>1) : $maxWright; | |||||
$maxWright = empty($maxWright)? array('cc'=>1) : $maxWright; | |||||
include DedeInclude("templets/article_add.htm"); | include DedeInclude("templets/article_add.htm"); | ||||
exit(); | exit(); | ||||
} | } | ||||
/*-------------------------------- | |||||
function __save(){ } | |||||
-------------------------------*/ | |||||
else if ($dopost == 'save') { | else if ($dopost == 'save') { | ||||
helper('image'); | |||||
require_once(DEDEINC.'/image.func.php'); | |||||
require_once(DEDEINC.'/libraries/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 = ''; | ||||
@@ -58,23 +62,23 @@ else if ($dopost == 'save') { | |||||
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(Lang('content_error_typeid_isempty'), "-1"); | |||||
ShowMsg("请指定文档的栏目", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (empty($channelid)) { | if (empty($channelid)) { | ||||
ShowMsg(Lang('content_error_channelid_isempty'), "-1"); | |||||
ShowMsg("文档为非指定的类型,请检查您发布内容的表单是否合法", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (!CheckChannel($typeid, $channelid)) { | if (!CheckChannel($typeid, $channelid)) { | ||||
ShowMsg(Lang('content_error_channelid_check_failed'), "-1"); | |||||
ShowMsg("您所选择的栏目与当前模型不相符,请选择白色的选项", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (!UserLogin::TestPurview('a_New')) { | |||||
UserLogin::CheckCatalog($typeid, Lang('content_error_channelid_check_failed',array('typeid'=>$typeid))); | |||||
if (!TestPurview('a_New')) { | |||||
CheckCatalog($typeid, "对不起,您没有操作栏目 {$typeid} 的权限"); | |||||
} | } | ||||
//对保存的内容进行处理 | //对保存的内容进行处理 | ||||
if (empty($writer)) $writer = $cUserLogin->getUserName(); | |||||
if (empty($source)) $source = Lang('unknow'); | |||||
if (empty($writer)) $writer = $cuserLogin->getUserName(); | |||||
if (empty($source)) $source = '未知'; | |||||
$pubdate = GetMkTime($pubdate); | $pubdate = GetMkTime($pubdate); | ||||
$senddate = time(); | $senddate = time(); | ||||
$sortrank = AddDay($pubdate, $sortup); | $sortrank = AddDay($pubdate, $sortup); | ||||
@@ -89,11 +93,12 @@ else if ($dopost == 'save') { | |||||
$keywords = cn_substrR($keywords, 60); | $keywords = cn_substrR($keywords, 60); | ||||
$filename = trim(cn_substrR($filename, 40)); | $filename = trim(cn_substrR($filename, 40)); | ||||
$userip = GetIP(); | $userip = GetIP(); | ||||
$isremote = 0; | |||||
$serviterm = empty($serviterm) ? "" : $serviterm; | $serviterm = empty($serviterm) ? "" : $serviterm; | ||||
if (!UserLogin::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; | ||||
@@ -102,11 +107,11 @@ else if ($dopost == 'save') { | |||||
//生成文档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(Lang("content_error_id_is_empty"), "-1"); | |||||
ShowMsg("无法获得主键,因此无法进行后续操作", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (trim($title) == '') { | if (trim($title) == '') { | ||||
ShowMsg(Lang("content_error_title_is_empty"), '-1'); | |||||
ShowMsg('标题不能为空', '-1'); | |||||
exit(); | exit(); | ||||
} | } | ||||
//处理body字段自动摘要、自动提取缩略图等 | //处理body字段自动摘要、自动提取缩略图等 | ||||
@@ -144,30 +149,30 @@ else if ($dopost == 'save') { | |||||
//跳转网址的文档强制为动态 | //跳转网址的文档强制为动态 | ||||
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,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');"; | |||||
$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(Lang('content_error_archives_save',array('error'=>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(Lang('content_error_no_maintable',array('channelid'=>$channelid)), "javascript:;"); | |||||
ShowMsg("没找到当前模型[{$channelid}]的主表信息,无法完成操作", "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$useip = GetIP(); | $useip = GetIP(); | ||||
$templet = empty($templet) ? '' : $templet; | $templet = empty($templet) ? '' : $templet; | ||||
$query = "INSERT INTO `{$addtable}`(aid,typeid,redirecturl,templet,userip,body{$inadd_f}) VALUES ('$arcID','$typeid','$redirecturl','$templet','$useip','$body'{$inadd_v})"; | |||||
$query = "INSERT INTO `{$addtable}` (aid,typeid,redirecturl,templet,userip,body{$inadd_f}) VALUES ('$arcID','$typeid','$redirecturl','$templet','$useip','$body'{$inadd_v})"; | |||||
if (!$dsql->ExecuteNoneQuery($query)) { | if (!$dsql->ExecuteNoneQuery($query)) { | ||||
$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(Lang('content_error_addtable_save',array('addtable'=>$addtable, 'error'=>str_replace('"', '', $gerr))), "javascript:;"); | |||||
ShowMsg("把数据保存到数据库附加表 `{$addtable}` 时出错,请把相关信息提交给DedeBIZ官方".str_replace('"', '', $gerr), "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
//生成网页 | //生成网页 | ||||
@@ -182,31 +187,35 @@ else if ($dopost == 'save') { | |||||
$picTitle = TRUE; | $picTitle = TRUE; | ||||
$titleSet = ",title='{$pictitle}'"; | $titleSet = ",title='{$pictitle}'"; | ||||
} | } | ||||
$dsql->ExecuteNoneQuery("UPDATE `#@__uploads` SET arcid='{$arcID}'{$titleSet} WHERE url LIKE '{$v}';"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `#@__uploads` SET arcid='{$arcID}'{$titleSet} WHERE url LIKE '{$v}'; "); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
$artUrl = MakeArt($arcID, true, true); | |||||
$artUrl = MakeArt($arcID, true, true, $isremote); | |||||
if ($artUrl == '') { | if ($artUrl == '') { | ||||
$artUrl = $cfg_phpurl."/view.php?aid=$arcID"; | $artUrl = $cfg_phpurl."/view.php?aid=$arcID"; | ||||
} | } | ||||
UserLogin::ClearMyAddon($arcID, $title); | |||||
ClearMyAddon($arcID, $title); | |||||
//自动更新关联内容 | //自动更新关联内容 | ||||
if (isset($automake) && 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})) { | ||||
$ids = explode(",", ${$key}); | $ids = explode(",", ${$key}); | ||||
foreach ($ids as $id) { | foreach ($ids as $id) { | ||||
MakeArt($id, true, true); | |||||
MakeArt($id, true, true, $isremote); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
//返回成功信息 | //返回成功信息 | ||||
$msg = Lang('more_actions').":<a href='article_add.php?cid=$typeid' class='btn btn-success btn-sm'>".Lang('content_continue_publish')."</a><a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>".Lang('content_view')."</a><a href='archives_do.php?aid=".$arcID."&dopost=editArchives' class='btn btn-success btn-sm'>".Lang('content_edit')."</a><a href='catalog_do.php?cid=$typeid&dopost=listArchives' class='btn btn-success btn-sm'>".Lang('content_published_main')."</a>$backurl"; | |||||
$msg = "<div>{$msg}</div>".GetUpdateTest(); | |||||
$wintitle = Lang("content_success_publish"); | |||||
$wecome_info = Lang('content_main')."::".Lang('content_add'); | |||||
DedeWin::Instance()->AddTitle(Lang('content_success_publish').":")->AddMsgItem($msg)->GetWindow("hand", " ", false)->Display(); | |||||
$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(); | |||||
$wintitle = "成功发布文档"; | |||||
$wecome_info = "文档管理::发布文档"; | |||||
$win = new OxWindow(); | |||||
$win->AddTitle("成功发布文档:"); | |||||
$win->AddMsgItem($msg); | |||||
$winform = $win->GetWindow("hand", " ", false); | |||||
$win->Display(); | |||||
} | } | ||||
?> | ?> |
@@ -8,10 +8,9 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DedeWin; | |||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('sys_Source'); | |||||
require_once(DEDEINC."/libraries/oxwindow.class.php"); | |||||
CheckPurview('sys_Source'); | |||||
if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
if (empty($allurls)) $allsource = ''; | if (empty($allurls)) $allsource = ''; | ||||
else $allurls = stripslashes($allurls); | else $allurls = stripslashes($allurls); | ||||
@@ -31,7 +30,12 @@ if (empty($allurls) && filesize($m_file) > 0) { | |||||
fclose($fp); | fclose($fp); | ||||
} | } | ||||
$wintitle = ""; | $wintitle = ""; | ||||
$wecome_info = Lang("content_allowurl_edit"); | |||||
DedeWin::Instance()->Init('article_allowurl_edit.php', 'js/blank.js', 'POST')->AddHidden('dopost', 'save') | |||||
->AddTitle(Lang("content_allowurl_edit_title"))->AddMsgItem("<textarea name='allurls' id='allurls' style='width:100%;height:300px'>$allurls</textarea>")->GetWindow('ok')->Display(); | |||||
$wecome_info = "允许的超链接"; | |||||
$win = new OxWindow(); | |||||
$win->Init('article_allowurl_edit.php', 'js/blank.js', 'POST'); | |||||
$win->AddHidden('dopost', 'save'); | |||||
$win->AddTitle("每行保存一个超链接:"); | |||||
$win->AddMsgItem("<textarea name='allurls' id='allurls' style='width:100%;height:300px'>$allurls</textarea>"); | |||||
$winform = $win->GetWindow('ok'); | |||||
$win->Display(); | |||||
?> | ?> |
@@ -8,87 +8,105 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DataListCP; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
require_once(DEDEINC."/datalistcp.class.php"); | |||||
setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/"); | setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/"); | ||||
if (empty($action)) $action = ''; | if (empty($action)) $action = ''; | ||||
/*------ | |||||
function _AddNote(){ } | |||||
-------*/ | |||||
if ($action == 'add') { | if ($action == 'add') { | ||||
$row = $dsql->GetOne("SELECT * FROM `#@__co_onepage` WHERE url LIKE '$url'"); | |||||
if (is_array($row)) { | |||||
echo Lang("content_coonepage_exists"); | |||||
} else { | |||||
$query = "INSERT INTO `#@__co_onepage` (`url`,`title`,`issource`,`lang`,`rule`) VALUES ('$url','$title','$issource','$lang','$rule');"; | |||||
$dsql->ExecuteNonequery($query); | |||||
echo $dsql->GetError(); | |||||
} | |||||
$row = $dsql->GetOne("SELECT * FROM `#@__co_onepage` WHERE url LIKE '$url' "); | |||||
if (is_array($row)) { | |||||
echo "系统已经存在这个网址的条目"; | |||||
} else { | |||||
$query = " INSERT INTO `#@__co_onepage` (`url`,`title`,`issource`,`lang`,`rule`) VALUES ('$url','$title','$issource','$lang','$rule'); "; | |||||
$dsql->ExecuteNonequery($query); | |||||
echo $dsql->GetError(); | |||||
} | |||||
} | } | ||||
/*------ | |||||
function _DelNote(){ } | |||||
-------*/ | |||||
else if ($action == 'del') { | else if ($action == 'del') { | ||||
if (!preg_match("#,#", $ids)) { | |||||
$query = "DELETE FROM `#@__co_onepage` WHERE id='$ids'"; | |||||
} else { | |||||
$query = "DELETE FROM `#@__co_onepage` WHERE id IN($ids)"; | |||||
} | |||||
$dsql->ExecuteNonequery($query); | |||||
if (!preg_match("#,#", $ids)) { | |||||
$query = "DELETE FROM `#@__co_onepage` WHERE id='$ids' "; | |||||
} else { | |||||
$query = "DELETE FROM `#@__co_onepage` WHERE id IN($ids) "; | |||||
} | |||||
$dsql->ExecuteNonequery($query); | |||||
} | } | ||||
/*------ | |||||
function _EditNote(){ } | |||||
-------*/ | |||||
else if ($action == 'editsave') { | else if ($action == 'editsave') { | ||||
$query = "UPDATE `#@__co_onepage` SET `url`='$url',`title`='$title',`issource`='$issource',`lang`='$lang',`rule`='$rule' WHERE id='$id'"; | |||||
$dsql->ExecuteNonequery($query); | |||||
echo $dsql->GetError(); | |||||
$query = "UPDATE `#@__co_onepage` SET `url`='$url',`title`='$title',`issource`='$issource',`lang`='$lang',`rule`='$rule' WHERE id='$id' "; | |||||
$dsql->ExecuteNonequery($query); | |||||
echo $dsql->GetError(); | |||||
} | } | ||||
/*------ | |||||
function _EditNoteLoad(){ } | |||||
-------*/ | |||||
else if ($action == 'editload') { | else if ($action == 'editload') { | ||||
$row = $dsql->GetOne("SELECT * FROM `#@__co_onepage` WHERE id='$id'"); | |||||
AjaxHead(); | |||||
$row = $dsql->GetOne("SELECT * FROM `#@__co_onepage` WHERE id='$id' "); | |||||
AjaxHead(); | |||||
?> | ?> | ||||
<form name="addform" action="article_coonepage_rule.php" method="post"> | |||||
<form name="addform" action="article_coonepage_rule.php" method="post"> | |||||
<input type="hidden" name="id" value="<?php echo $id;?>"> | <input type="hidden" name="id" value="<?php echo $id;?>"> | ||||
<input type="hidden" name="action" value="editsave"> | <input type="hidden" name="action" value="editsave"> | ||||
<table width="430" cellspacing="0" cellpadding="0"> | <table width="430" cellspacing="0" cellpadding="0"> | ||||
<tr> | |||||
<td width="90"><?php echo Lang('content_coonepage_editload_title');?></td> | |||||
<td width="270"><input type="text" name="title" id="title" style="width:260px" value="<?php echo $row['title'];?>"></td> | |||||
</tr> | |||||
<tr> | |||||
<td><?php echo Lang('content_coonepage_editload_lang');?></td> | |||||
<td colspan="2"> | |||||
<label><input type="radio" name="lang" value="utf-8" <?php echo ($row['lang'] == 'utf-8' ? 'checked="checked"' : '');?>> UTF-8</label> | |||||
<label><input type="radio" name="lang" value="gb2312" <?php echo ($row['lang'] == 'gb2312' ? 'checked="checked"' : '');?>> GB2312/GBK</label> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td><?php echo Lang('content_coonepage_editload_issource');?></td> | |||||
<td colspan="2"> | |||||
<label><input type="radio" name="issource" value="0" <?php echo ($row['issource'] == 0 ? 'checked="checked"' : '');?>> <?php echo Lang('no');?></label> | |||||
<label><input type="radio" name="issource" value="1" <?php echo ($row['issource'] == 1 ? 'checked="checked"' : '');?>> <?php echo Lang('yes');?></label> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td><?php echo Lang('content_coonepage_editload_url');?></td> | |||||
<td colspan="2"><input type="text" name="url" id="url" value="<?php echo $row['url'];?>" style="width:260px"></td> | |||||
</tr> | |||||
<tr> | |||||
<td></td> | |||||
<td colspan="2"><?php echo Lang('content_coonepage_tip');?></td> | |||||
</tr> | |||||
<tr> | |||||
<td><?php echo Lang('content_coonepage_editload_rule');?></td> | |||||
<td colspan="2"><?php echo Lang('content_coonepage_editload_rule_tip');?></td> | |||||
</tr> | |||||
<tr> | |||||
<td height="90"></td> | |||||
<td colspan="2"><textarea name="rule" style="width:300px;height:80px"><?php echo $row['rule'];?></textarea></td> | |||||
</tr> | |||||
<tr> | |||||
<td></td> | |||||
<td colspan="2"> | |||||
<button class="btn btn-success btn-sm" type="submit" name="Submit"><?php echo Lang('save');?></button> | |||||
<button class="btn btn-success btn-sm" type="button" name="Submit2" onclick="javascript:CloseEditNode();"><?php echo Lang('close');?></button> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td width="90">网站名称:</td> | |||||
<td width="270"><input type="text" name="title" id="title" style="width:260px" value="<?php echo $row['title'];?>"></td> | |||||
</tr> | |||||
<tr> | |||||
<td>原内容编码:</td> | |||||
<td colspan="2"> | |||||
<label><input type="radio" name="lang" value="utf-8" <?php echo ($row['lang'] == 'utf-8' ? 'checked="checked"' : '');?>> UTF-8</label> | |||||
<label><input type="radio" name="lang" value="gb2312" <?php echo ($row['lang'] == 'gb2312' ? 'checked="checked"' : '');?>> GB2312/GBK</label> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>用作文档来源:</td> | |||||
<td colspan="2"> | |||||
<label><input type="radio" name="issource" value="0" <?php echo ($row['issource'] == 0 ? 'checked="checked"' : '');?>> 否</label> | |||||
<label><input type="radio" name="issource" value="1" <?php echo ($row['issource'] == 1 ? 'checked="checked"' : '');?>> 是</label> | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>网站网址:</td> | |||||
<td colspan="2"><input type="text" name="url" id="url" value="<?php echo $row['url'];?>" style="width:260px"></td> | |||||
</tr> | |||||
<tr> | |||||
<td></td> | |||||
<td colspan="2"> | |||||
使用不带http及任何附加目录的网址<br> | |||||
如:news.dedebiz.com | |||||
</td> | |||||
</tr> | |||||
<tr> | |||||
<td>采集规则:</td> | |||||
<td colspan="2">仅针对文档内容,格式:前面HTML{@body}后面HMTL</td> | |||||
</tr> | |||||
<tr> | |||||
<td height="90"></td> | |||||
<td colspan="2"><textarea name="rule" style="width:300px;height:80px"><?php echo $row['rule'];?></textarea></td> | |||||
</tr> | |||||
<tr> | |||||
<td></td> | |||||
<td colspan="2"> | |||||
<button class="btn btn-success btn-sm" type="submit" name="Submit">保存</button> | |||||
<button class="btn btn-success btn-sm" type="button" name="Submit2" onclick="javascript:CloseEditNode();">关闭</button> | |||||
</td> | |||||
</tr> | |||||
</table> | </table> | ||||
</form> | |||||
</form> | |||||
<?php | <?php | ||||
exit(); | |||||
} | |||||
exit(); | |||||
} //loadedit | |||||
/*--------------- | |||||
function _ShowLoad(){ } | |||||
-------------*/ | |||||
$sql = ""; | $sql = ""; | ||||
$sql = "SELECT id,url,title,lang,issource FROM `#@__co_onepage` ORDER BY id DESC"; | $sql = "SELECT id,url,title,lang,issource FROM `#@__co_onepage` ORDER BY id DESC"; | ||||
$dlist = new DataListCP(); | $dlist = new DataListCP(); | ||||
@@ -8,11 +8,10 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
@ob_start(); | @ob_start(); | ||||
@set_time_limit(3600); | @set_time_limit(3600); | ||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('sys_Keyword'); | |||||
CheckPurview('sys_Keyword'); | |||||
if (empty($dojob)) $dojob = ''; | if (empty($dojob)) $dojob = ''; | ||||
if ($dojob == '') { | if ($dojob == '') { | ||||
include DedeInclude("templets/article_description_main.htm"); | include DedeInclude("templets/article_description_main.htm"); | ||||
@@ -46,12 +45,12 @@ if ($dojob == '') { | |||||
if ($totalnum > 0) { | if ($totalnum > 0) { | ||||
$addquery = ""; | $addquery = ""; | ||||
if ($sid != 0) { | if ($sid != 0) { | ||||
$addquery .= " AND `#@__archives`.id>='$sid' "; | |||||
$addquery .= " AND #@__archives.id>='$sid' "; | |||||
} | } | ||||
if ($eid != 0) { | if ($eid != 0) { | ||||
$addquery .= " AND `#@__archives`.id<='$eid' "; | |||||
$addquery .= " AND #@__archives.id<='$eid' "; | |||||
} | } | ||||
$fquery = "SELECT `#@__archives`.id,`#@__archives`.title,`#@__archives`.description,{$table}.{$field} FROM `#@__archives` LEFT JOIN {$table} ON {$table}.aid=`#@__archives`.id WHERE `#@__archives`.channel='{$channel}' $addquery LIMIT $startdd,$pagesize;"; | |||||
$fquery = "SELECT `#@__archives`.id,`#@__archives`.title,`#@__archives`.description,{$table}.{$field} FROM `#@__archives` LEFT JOIN {$table} ON {$table}.aid=`#@__archives`.id WHERE `#@__archives`.channel='{$channel}' $addquery LIMIT $startdd,$pagesize ; "; | |||||
$dsql->SetQuery($fquery); | $dsql->SetQuery($fquery); | ||||
$dsql->Execute(); | $dsql->Execute(); | ||||
while ($row = $dsql->GetArray()) { | while ($row = $dsql->GetArray()) { | ||||
@@ -76,17 +75,17 @@ if ($dojob == '') { | |||||
$tjlen = ceil(($startdd / $totalnum) * 100); | $tjlen = ceil(($startdd / $totalnum) * 100); | ||||
} else { | } else { | ||||
$tjlen = 100; | $tjlen = 100; | ||||
ShowMsg(Lang('article_description_success'), 'javascript:;'); | |||||
ShowMsg('完成所有任务', 'javascript:;'); | |||||
exit(); | exit(); | ||||
} | } | ||||
$dvlen = $tjlen * 1; | $dvlen = $tjlen * 1; | ||||
$tjsta = "<div style='width:260px;height:16px;border:1px solid #1eb867;text-align:left'><div style='max-width:260px;width:$dvlen%;height:16px;background:#1eb867'></div></div>"; | |||||
$tjsta .= "<br>".Lang('article_description_success_arcnum')." $tjlen %"; | |||||
$tjsta = "<div style='width:260px;height:16px;border:1px solid #28a745;text-align:left'><div style='max-width:260px;width:$dvlen%;height:16px;background:#28a745'></div></div>"; | |||||
$tjsta .= "<br>完成处理文档总数 $tjlen %"; | |||||
$nurl = "article_description_main.php?totalnum=$totalnum&startdd={$startdd}&pagesize=$pagesize&table={$table}&field={$field}&dsize={$dsize}&msize={$msize}&channel={$channel}&dojob={$dojob}"; | $nurl = "article_description_main.php?totalnum=$totalnum&startdd={$startdd}&pagesize=$pagesize&table={$table}&field={$field}&dsize={$dsize}&msize={$msize}&channel={$channel}&dojob={$dojob}"; | ||||
ShowMsg($tjsta, $nurl, 0, 500); | ShowMsg($tjsta, $nurl, 0, 500); | ||||
exit(); | exit(); | ||||
} else { | } else { | ||||
ShowMsg(Lang('article_description_success'), 'javascript:;'); | |||||
ShowMsg('完成所有任务', 'javascript:;'); | |||||
exit(); | exit(); | ||||
} | } | ||||
}//获取自动摘要代码结束 | }//获取自动摘要代码结束 | ||||
@@ -129,7 +128,7 @@ if ($dojob == '') { | |||||
if (!preg_match("/#p#/iU", $body)) { | if (!preg_match("/#p#/iU", $body)) { | ||||
$body = SpLongBody($body, $cfg_arcautosp_size * 1024, "#p#分页标题#e#"); | $body = SpLongBody($body, $cfg_arcautosp_size * 1024, "#p#分页标题#e#"); | ||||
$body = addslashes($body); | $body = addslashes($body); | ||||
$dsql->ExecuteNoneQuery("UPDATE $table SET $field='$body' WHERE aid='$aid';"); | |||||
$dsql->ExecuteNoneQuery("UPDATE $table SET $field='$body' WHERE aid='$aid' ; "); | |||||
} | } | ||||
} | } | ||||
}//end if limit | }//end if limit | ||||
@@ -140,14 +139,14 @@ if ($dojob == '') { | |||||
$tjlen = 100; | $tjlen = 100; | ||||
} | } | ||||
$dvlen = $tjlen * 1; | $dvlen = $tjlen * 1; | ||||
$tjsta = "<div style='width:260px;height:16px;border:1px solid #1eb867;text-align:left'><div style='max-width:260px;width:$dvlen%;height:16px;background:#1eb867'></div></div>"; | |||||
$tjsta .= "<br>".Lang('article_description_success_arcnum')." $tjlen %"; | |||||
$tjsta = "<div style='width:260px;height:16px;border:1px solid #28a745;text-align:left'><div style='max-width:260px;width:$dvlen%;height:16px;background:#28a745'></div></div>"; | |||||
$tjsta .= "<br>完成处理文档总数 $tjlen %"; | |||||
if ($tjnum < $totalnum) { | if ($tjnum < $totalnum) { | ||||
$nurl = "article_description_main.php?totalnum=$totalnum&startdd=".($startdd + $pagesize)."&pagesize=$pagesize&table={$table}&field={$field}&dsize={$dsize}&msize={$msize}&channel={$channel}&dojob={$dojob}"; | $nurl = "article_description_main.php?totalnum=$totalnum&startdd=".($startdd + $pagesize)."&pagesize=$pagesize&table={$table}&field={$field}&dsize={$dsize}&msize={$msize}&channel={$channel}&dojob={$dojob}"; | ||||
ShowMsg($tjsta, $nurl, 0, 500); | ShowMsg($tjsta, $nurl, 0, 500); | ||||
exit(); | exit(); | ||||
} else { | } else { | ||||
ShowMsg(Lang('article_description_success'), 'javascript:;'); | |||||
ShowMsg('完成所有任务', 'javascript:;'); | |||||
exit(); | exit(); | ||||
} | } | ||||
}//更新自动分页处理代码结束 | }//更新自动分页处理代码结束 | ||||
@@ -8,10 +8,9 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DedeWin; | |||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('a_Edit,a_AccEdit,a_MyEdit'); | |||||
CheckPurview('a_Edit,a_AccEdit,a_MyEdit'); | |||||
require_once(DEDEINC."/customfields.func.php"); | |||||
require_once(DEDEADMIN."/inc/inc_archives_functions.php"); | require_once(DEDEADMIN."/inc/inc_archives_functions.php"); | ||||
if (file_exists(DEDEDATA.'/template.rand.php')) { | if (file_exists(DEDEDATA.'/template.rand.php')) { | ||||
require_once(DEDEDATA.'/template.rand.php'); | require_once(DEDEDATA.'/template.rand.php'); | ||||
@@ -20,24 +19,25 @@ 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"); | ||||
UserLogin::ClearMyAddon(); | |||||
require_once(DEDEINC."/dedetag.class.php"); | |||||
ClearMyAddon(); | |||||
//读取归档信息 | //读取归档信息 | ||||
$query = "SELECT ch.typename AS channelname,ar.membername AS rankname,arc.* FROM `#@__archives` arc LEFT JOIN `#@__channeltype` ch ON ch.id=arc.channel LEFT JOIN `#@__arcrank` ar ON ar.`rank`=arc.arcrank WHERE arc.id='$aid'"; | |||||
$query = "SELECT ch.typename AS channelname,ar.membername AS rankname,arc.* FROM `#@__archives` arc LEFT JOIN `#@__channeltype` ch ON ch.id=arc.channel 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(Lang("content_err_archive"), "-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(Lang("content_err_channel"), "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(Lang("content_err_addon"), "javascript:;"); | |||||
ShowMsg("读取附加信息出错", "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$channelid = $arcRow['channel']; | $channelid = $arcRow['channel']; | ||||
@@ -45,8 +45,12 @@ if ($dopost != 'save') { | |||||
include DedeInclude("templets/article_edit.htm"); | include DedeInclude("templets/article_edit.htm"); | ||||
exit(); | exit(); | ||||
} | } | ||||
/*-------------------------------- | |||||
function __save(){ } | |||||
-------------------------------*/ | |||||
else if ($dopost == 'save') { | else if ($dopost == 'save') { | ||||
helper('image'); | |||||
require_once(DEDEINC.'/image.func.php'); | |||||
require_once(DEDEINC.'/libraries/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; | ||||
@@ -55,22 +59,22 @@ else if ($dopost == 'save') { | |||||
if (!isset($dellink)) $dellink = 0; | if (!isset($dellink)) $dellink = 0; | ||||
if (!isset($autolitpic)) $autolitpic = 0; | if (!isset($autolitpic)) $autolitpic = 0; | ||||
if (empty($typeid)) { | if (empty($typeid)) { | ||||
ShowMsg(Lang('content_error_typeid_isempty'), "-1"); | |||||
ShowMsg("请指定文档的栏目", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (empty($channelid)) { | if (empty($channelid)) { | ||||
ShowMsg(Lang('content_error_channelid_isempty'), "-1"); | |||||
ShowMsg("文档为非指定的类型,请检查您发布内容的表单是否合法", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (!CheckChannel($typeid, $channelid)) { | if (!CheckChannel($typeid, $channelid)) { | ||||
ShowMsg(Lang('content_error_channelid_check_failed'), "-1"); | |||||
ShowMsg("您所选择的栏目与当前模型不相符,请选择白色的选项", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (!UserLogin::TestPurview('a_Edit')) { | |||||
if (UserLogin::TestPurview('a_AccEdit')) { | |||||
UserLogin::CheckCatalog($typeid, Lang('content_error_channelid_check_failed',array('typeid'=>$typeid))); | |||||
if (!TestPurview('a_Edit')) { | |||||
if (TestPurview('a_AccEdit')) { | |||||
CheckCatalog($typeid, "对不起,您没有操作栏目 {$typeid} 的文档权限"); | |||||
} else { | } else { | ||||
CheckArcAdmin($id, $cUserLogin->getUserID()); | |||||
CheckArcAdmin($id, $cuserLogin->getUserID()); | |||||
} | } | ||||
} | } | ||||
//对保存的内容进行处理 | //对保存的内容进行处理 | ||||
@@ -86,11 +90,12 @@ else if ($dopost == 'save') { | |||||
$description = cn_substrR($description, 250); | $description = cn_substrR($description, 250); | ||||
$keywords = trim(cn_substrR($keywords, 60)); | $keywords = trim(cn_substrR($keywords, 60)); | ||||
$filename = trim(cn_substrR($filename, 40)); | $filename = trim(cn_substrR($filename, 40)); | ||||
$isremote = 0; | |||||
$serviterm = empty($serviterm) ? "" : $serviterm; | $serviterm = empty($serviterm) ? "" : $serviterm; | ||||
if (!UserLogin::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; | ||||
@@ -111,7 +116,7 @@ else if ($dopost == 'save') { | |||||
continue; | continue; | ||||
} | } | ||||
$vs = explode(',', $v); | $vs = explode(',', $v); | ||||
if ($vs[1] == 'htmltext' || $vs[1] == 'textdata') //网页文本特殊处理 | |||||
if ($vs[1] == 'htmltext' || $vs[1] == 'textdata') //HTML文本特殊处理 | |||||
{ | { | ||||
${$vs[0]} = AnalyseHtmlBody(${$vs[0]}, $description, $litpic, $keywords, $vs[1]); | ${$vs[0]} = AnalyseHtmlBody(${$vs[0]}, $description, $litpic, $keywords, $vs[1]); | ||||
} else { | } else { | ||||
@@ -134,66 +139,49 @@ else if ($dopost == 'save') { | |||||
//跳转网址的文档强制为动态 | //跳转网址的文档强制为动态 | ||||
if (preg_match("#j#", $flag)) $ismake = -1; | if (preg_match("#j#", $flag)) $ismake = -1; | ||||
//更新数据库的SQL语句 | //更新数据库的SQL语句 | ||||
$query = "UPDATE `#@__archives` SET | |||||
typeid='$typeid', | |||||
typeid2='$typeid2', | |||||
sortrank='$sortrank', | |||||
flag='$flag', | |||||
click='$click', | |||||
ismake='$ismake', | |||||
arcrank='$arcrank', | |||||
money='$money', | |||||
title='$title', | |||||
color='$color', | |||||
writer='$writer', | |||||
source='$source', | |||||
litpic='$litpic', | |||||
pubdate='$pubdate', | |||||
notpost='$notpost', | |||||
DESCription='$description', | |||||
keywords='$keywords', | |||||
shorttitle='$shorttitle', | |||||
filename='$filename', | |||||
dutyadmin='$adminid', | |||||
weight='$weight' | |||||
WHERE id='$id'; "; | |||||
$query = "UPDATE `#@__archives` SETtypeid='$typeid',typeid2='$typeid2',sortrank='$sortrank',flag='$flag',click='$click',ismake='$ismake',arcrank='$arcrank',money='$money',title='$title',color='$color',writer='$writer',source='$source',litpic='$litpic',pubdate='$pubdate',notpost='$notpost',description='$description',keywords='$keywords',shorttitle='$shorttitle',filename='$filename',dutyadmin='$adminid',weight='$weight'WHERE id='$id'; "; | |||||
if (!$dsql->ExecuteNoneQuery($query)) { | if (!$dsql->ExecuteNoneQuery($query)) { | ||||
ShowMsg(Lang('content_err_update_archive'), -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(); | ||||
$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(Lang('content_err_update_addon',array('addtable'=>$addtable)), "javascript:;"); | |||||
ShowMsg("更新附加表 `$addtable` 时出错,请检查原因", "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
} | } | ||||
//生成网页 | //生成网页 | ||||
UpIndexKey($id, $arcrank, $typeid, $sortrank, $tags); | UpIndexKey($id, $arcrank, $typeid, $sortrank, $tags); | ||||
$artUrl = MakeArt($id, true, true); | |||||
$artUrl = MakeArt($id, true, true, $isremote); | |||||
if ($artUrl == '') { | if ($artUrl == '') { | ||||
$artUrl = $cfg_phpurl."/view.php?aid=$id"; | $artUrl = $cfg_phpurl."/view.php?aid=$id"; | ||||
} | } | ||||
UserLogin::ClearMyAddon($id, $title); | |||||
ClearMyAddon($id, $title); | |||||
//自动更新关联内容 | //自动更新关联内容 | ||||
if (isset($automake) && 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})) { | ||||
$ids = explode(",", ${$key}); | $ids = explode(",", ${$key}); | ||||
foreach ($ids as $id) { | foreach ($ids as $id) { | ||||
MakeArt($id, true, true); | |||||
MakeArt($id, true, true, $isremote); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
} | } | ||||
//返回成功信息 | //返回成功信息 | ||||
$msg = Lang('more_actions').":<a href='article_add.php?cid=$typeid' class='btn btn-success btn-sm'>".Lang('content_publish_new')."</a><a href='archives_do.php?aid=".$id."&dopost=editArchives' class='btn btn-success btn-sm'>".Lang('content_edit')."</a><a href='$artUrl' target='_blank' class='btn btn-success btn-sm'>".Lang('content_view')."</a><a href='catalog_do.php?cid=$typeid&dopost=listArchives' class='btn btn-success btn-sm'>".Lang('content_main')."</a>$backurl"; | |||||
$wintitle = Lang("content_success_edit"); | |||||
$wecome_info = Lang('content_main')."::".Lang('content_edit'); | |||||
DedeWin::Instance()->AddTitle(Lang("content_success_edit").":")->AddMsgItem($msg)->GetWindow("hand", " ", false)->Display(); | |||||
$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 = "文档管理::修改文档"; | |||||
$win = new OxWindow(); | |||||
$win->AddTitle("成功修改文档:"); | |||||
$win->AddMsgItem($msg); | |||||
$winform = $win->GetWindow("hand", " ", false); | |||||
$win->Display(); | |||||
} | } | ||||
?> | ?> |
@@ -8,17 +8,16 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DataListCP; | |||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('sys_Keyword'); | |||||
CheckPurview('sys_Keyword'); | |||||
require_once(DEDEINC."/datalistcp.class.php"); | |||||
setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/"); | setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/"); | ||||
if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
//保存批量修改 | //保存批量修改 | ||||
if ($dopost == 'saveall') { | if ($dopost == 'saveall') { | ||||
$ENV_GOBACK_URL = empty($_COOKIE['ENV_GOBACK_URL']) ? "article_keywords_main.php" : $_COOKIE['ENV_GOBACK_URL']; | $ENV_GOBACK_URL = empty($_COOKIE['ENV_GOBACK_URL']) ? "article_keywords_main.php" : $_COOKIE['ENV_GOBACK_URL']; | ||||
if (!isset($aids)) { | if (!isset($aids)) { | ||||
ShowMsg(Lang("article_keywords_err_select"), $ENV_GOBACK_URL); | |||||
ShowMsg("您没有选择要修改的内容", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} | } | ||||
foreach ($aids as $aid) { | foreach ($aids as $aid) { | ||||
@@ -34,17 +33,17 @@ if ($dopost == 'saveall') { | |||||
$staold = ${'staold_'.$aid}; | $staold = ${'staold_'.$aid}; | ||||
$sta = empty(${'isnouse_'.$aid}) ? 1 : 0; | $sta = empty(${'isnouse_'.$aid}) ? 1 : 0; | ||||
if ($staold != $sta) { | if ($staold != $sta) { | ||||
$query1 = "UPDATE `#@__keywords` SET sta='$sta',rpurl='$rpurl' WHERE aid='$aid'"; | |||||
$query1 = "UPDATE `#@__keywords` SET sta='$sta',rpurl='$rpurl' WHERE aid='$aid' "; | |||||
$dsql->ExecuteNoneQuery($query1); | $dsql->ExecuteNoneQuery($query1); | ||||
continue; | continue; | ||||
} | } | ||||
//更新链接网址 | //更新链接网址 | ||||
if ($rpurl != $rpurlold) { | if ($rpurl != $rpurlold) { | ||||
$query1 = "UPDATE `#@__keywords` SET rpurl='$rpurl' WHERE aid='$aid'"; | |||||
$query1 = "UPDATE `#@__keywords` SET rpurl='$rpurl' WHERE aid='$aid' "; | |||||
$dsql->ExecuteNoneQuery($query1); | $dsql->ExecuteNoneQuery($query1); | ||||
} | } | ||||
} | } | ||||
ShowMsg(Lang("article_keywords_edit_success"), $ENV_GOBACK_URL); | |||||
ShowMsg("完成指定的修改", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} | } | ||||
//增加关键词 | //增加关键词 | ||||
@@ -53,24 +52,24 @@ else if ($dopost == 'add') { | |||||
$keyword = trim($keyword); | $keyword = trim($keyword); | ||||
$rank = preg_replace("#[^0-9]#", '', $rank); | $rank = preg_replace("#[^0-9]#", '', $rank); | ||||
if ($keyword == '') { | if ($keyword == '') { | ||||
ShowMsg(Lang("article_keywords_err_isempty"), -1); | |||||
ShowMsg("关键词不能为空", -1); | |||||
exit(); | exit(); | ||||
} | } | ||||
$row = $dsql->GetOne("SELECT * FROM `#@__keywords` WHERE keyword LIKE '$keyword'"); | $row = $dsql->GetOne("SELECT * FROM `#@__keywords` WHERE keyword LIKE '$keyword'"); | ||||
if (is_array($row)) { | if (is_array($row)) { | ||||
ShowMsg(Lang("article_keywords_err_isexists"), "-1"); | |||||
ShowMsg("关键词已存在库中", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$inquery = "INSERT INTO `#@__keywords`(keyword,`rank`,sta,rpurl) VALUES ('$keyword','$rank','1','$rpurl');"; | $inquery = "INSERT INTO `#@__keywords`(keyword,`rank`,sta,rpurl) VALUES ('$keyword','$rank','1','$rpurl');"; | ||||
$dsql->ExecuteNoneQuery($inquery); | $dsql->ExecuteNoneQuery($inquery); | ||||
ShowMsg(Lang("article_keywords_add_success"), $ENV_GOBACK_URL); | |||||
ShowMsg("成功增加一个关键词", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (empty($keyword)) { | if (empty($keyword)) { | ||||
$keyword = ''; | $keyword = ''; | ||||
$addquery = ''; | $addquery = ''; | ||||
} else { | } else { | ||||
$addquery = "WHERE keyword LIKE '%$keyword%'"; | |||||
$addquery = " WHERE keyword LIKE '%$keyword%' "; | |||||
} | } | ||||
$sql = "SELECT * FROM `#@__keywords` $addquery ORDER BY `rank` DESC"; | $sql = "SELECT * FROM `#@__keywords` $addquery ORDER BY `rank` DESC"; | ||||
$dlist = new DataListCP(); | $dlist = new DataListCP(); | ||||
@@ -8,8 +8,8 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DataListCP; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
require_once(DEDEINC."/datalistcp.class.php"); | |||||
setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/"); | setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/"); | ||||
$f = RemoveXSS($f); | $f = RemoveXSS($f); | ||||
if (empty($keywords)) $keywords = ""; | if (empty($keywords)) $keywords = ""; | ||||
@@ -22,12 +22,12 @@ $dlist->SetSource($sql); | |||||
$dlist->Display(); | $dlist->Display(); | ||||
function GetSta($sta) | function GetSta($sta) | ||||
{ | { | ||||
if ($sta == 1) return Lang("enable"); | |||||
else return "<span class='text-danger'>".Lang('disable')."</span>"; | |||||
if ($sta == 1) return "正常"; | |||||
else return "<span class='text-danger'>禁用</span>"; | |||||
} | } | ||||
function GetMan($sta) | function GetMan($sta) | ||||
{ | { | ||||
if ($sta == 1) return Lang("disable"); | |||||
else return Lang("enable"); | |||||
if ($sta == 1) return "禁用"; | |||||
else return "启用"; | |||||
} | } | ||||
?> | ?> |
@@ -14,20 +14,20 @@ header("Expires:0"); | |||||
if ($t == 'source') { | if ($t == 'source') { | ||||
$m_file = DEDEDATA."/admin/source.txt"; | $m_file = DEDEDATA."/admin/source.txt"; | ||||
$allsources = file($m_file); | $allsources = file($m_file); | ||||
echo "<div class='coolbg4 p-2'><a href=\"javascript:OpenMyWin('article_source_edit.php');ClearDivCt('mysource');\" class='btn btn-success btn-sm'>".Lang('setting')."</a>"; | |||||
echo "<a href='javascript:;' onclick='javascript:HideObj(\"mysource\");ChangeFullDiv(\"hide\");' class='btn btn-success btn-sm'>".Lang('close')."</a></div><div class='wsselect'>"; | |||||
echo "<div class='coolbg4'>[<a href=\"javascript:OpenMyWin('article_source_edit.php');ClearDivCt('mysource');\">设置</a>]"; | |||||
echo "[<a href='javascript:;' onclick='javascript:HideObj(\"mysource\");ChangeFullDiv(\"hide\");'>关闭</a>]</div>\r\n<div class='wsselect'>\r\n"; | |||||
foreach ($allsources as $v) { | foreach ($allsources as $v) { | ||||
$v = trim($v); | $v = trim($v); | ||||
if ($v != "") { | if ($v != "") { | ||||
echo "<a href='javascript:;' onclick='javascript:PutSource(\"$v\")'>$v</a> | "; | |||||
echo "<a href='javascript:;' onclick='javascript:PutSource(\"$v\")'>$v</a> | \r\n"; | |||||
} | } | ||||
} | } | ||||
echo "</div><div class='coolbg5'> </div>"; | echo "</div><div class='coolbg5'> </div>"; | ||||
} else { | } else { | ||||
//作者列表 | //作者列表 | ||||
$m_file = DEDEDATA."/admin/writer.txt"; | $m_file = DEDEDATA."/admin/writer.txt"; | ||||
echo "<div class='coolbg4 p-2'><a href=\"javascript:OpenMyWin('article_writer_edit.php');ClearDivCt('mywriter');\" class='btn btn-success btn-sm'>".Lang('setting')."</a>"; | |||||
echo "<a href='javascript:;' onclick='javascript:HideObj(\"mywriter\");ChangeFullDiv(\"hide\");' class='btn btn-success btn-sm'>".Lang('close')."</a></div><div class='wsselect'>"; | |||||
echo "<div class='coolbg4'>[<a href=\"javascript:OpenMyWin('article_writer_edit.php');ClearDivCt('mywriter');\">设置</a>]"; | |||||
echo "[<a href='javascript:;' onclick='javascript:HideObj(\"mywriter\");ChangeFullDiv(\"hide\");'>关闭</a>]</div>\r\n<div class='wsselect'>\r\n"; | |||||
if (filesize($m_file) > 0) { | if (filesize($m_file) > 0) { | ||||
$fp = fopen($m_file, 'r'); | $fp = fopen($m_file, 'r'); | ||||
$str = fread($fp, filesize($m_file)); | $str = fread($fp, filesize($m_file)); | ||||
@@ -40,6 +40,6 @@ if ($t == 'source') { | |||||
} | } | ||||
} | } | ||||
} | } | ||||
echo "</div>"; | |||||
echo "</div><div class='coolbg5'> </div>\r\n"; | |||||
} | } | ||||
?> | ?> |
@@ -8,10 +8,9 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DedeWin; | |||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('sys_Source'); | |||||
require_once(DEDEINC."/libraries/oxwindow.class.php"); | |||||
CheckPurview('sys_Source'); | |||||
if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
if (empty($allsource)) $allsource = ''; | if (empty($allsource)) $allsource = ''; | ||||
else $allsource = stripslashes($allsource); | else $allsource = stripslashes($allsource); | ||||
@@ -30,8 +29,13 @@ if (empty($allsource) && filesize($m_file) > 0) { | |||||
$allsource = fread($fp, filesize($m_file)); | $allsource = fread($fp, filesize($m_file)); | ||||
fclose($fp); | fclose($fp); | ||||
} | } | ||||
$wintitle = Lang("content_source_main"); | |||||
$wecome_info = Lang("content_source_main"); | |||||
DedeWin::Instance()->Init('article_source_edit.php', 'js/blank.js', 'POST')->AddHidden('dopost', 'save') | |||||
->AddTitle(Lang("content_source_main_title"))->AddMsgItem("<textarea name='allsource' id='allsource' style='width:100%;height:300px'>$allsource</textarea>")->GetWindow('ok')->Display(); | |||||
$wintitle = "文档来源管理"; | |||||
$wecome_info = "文档来源管理"; | |||||
$win = new OxWindow(); | |||||
$win->Init('article_source_edit.php', 'js/blank.js', 'POST'); | |||||
$win->AddHidden('dopost', 'save'); | |||||
$win->AddTitle("每行保存一个来源:"); | |||||
$win->AddMsgItem("<textarea name='allsource' id='allsource' style='width:100%;height:300px'>$allsource</textarea>"); | |||||
$winform = $win->GetWindow('ok'); | |||||
$win->Display(); | |||||
?> | ?> |
@@ -8,10 +8,9 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DedeWin; | |||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__).'/config.php'); | require_once(dirname(__FILE__).'/config.php'); | ||||
UserLogin::CheckPurview('sys_StringMix'); | |||||
require_once(DEDEINC.'/libraries/oxwindow.class.php'); | |||||
CheckPurview('sys_StringMix'); | |||||
if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
if (empty($allsource)) $allsource = ''; | if (empty($allsource)) $allsource = ''; | ||||
else $allsource = stripslashes($allsource); | else $allsource = stripslashes($allsource); | ||||
@@ -23,7 +22,7 @@ if ($dopost == "save") { | |||||
flock($fp, 3); | flock($fp, 3); | ||||
fwrite($fp, $allsource); | fwrite($fp, $allsource); | ||||
fclose($fp); | fclose($fp); | ||||
echo "<script>alert('".Lang('operation_successful')."');</script>"; | |||||
echo "<script>alert('Save OK!');</script>"; | |||||
} | } | ||||
//读出 | //读出 | ||||
if (empty($allsource) && filesize($m_file) > 0) { | if (empty($allsource) && filesize($m_file) > 0) { | ||||
@@ -32,12 +31,14 @@ if (empty($allsource) && filesize($m_file) > 0) { | |||||
fclose($fp); | fclose($fp); | ||||
} | } | ||||
make_hash(); | make_hash(); | ||||
$wintitle = Lang("article_string_mix"); | |||||
$wecome_info = Lang("article_string_mix"); | |||||
DedeWin::Instance()->Init('article_string_mix.php', 'js/blank.js', 'POST') | |||||
->AddHidden('dopost', 'save') | |||||
->AddHidden('token', $_SESSION['token']) | |||||
->AddTitle(Lang("article_string_mix_title")) | |||||
->AddMsgItem("<textarea name='allsource' id='allsource' style='width:100%;height:300px'>$allsource</textarea>") | |||||
->GetWindow('ok')->Display(); | |||||
$wintitle = "防采集混淆字符串管理"; | |||||
$wecome_info = "防采集混淆字符串管理"; | |||||
$win = new OxWindow(); | |||||
$win->Init('article_string_mix.php', 'js/blank.js', 'POST'); | |||||
$win->AddHidden('dopost', 'save'); | |||||
$win->AddHidden('token', $_SESSION['token']); | |||||
$win->AddTitle("如果您要启用字符串混淆来防采集,请在文档模板需要的字段加上 function='RndString(@me)' 属性,如:{dede:field name='body' function='RndString(@me)'/}"); | |||||
$win->AddMsgItem("<textarea name='allsource' id='allsource' style='width:100%;height:300px'>$allsource</textarea>"); | |||||
$winform = $win->GetWindow('ok'); | |||||
$win->Display(); | |||||
?> | ?> |
@@ -8,13 +8,12 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DedeWin; | |||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__).'/config.php'); | require_once(dirname(__FILE__).'/config.php'); | ||||
UserLogin::CheckPurview('sys_StringMix'); | |||||
require_once(DEDEINC.'/libraries/oxwindow.class.php'); | |||||
CheckPurview('sys_StringMix'); | |||||
if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
$templates = empty($templates) ? '' : stripslashes($templates); | $templates = empty($templates) ? '' : stripslashes($templates); | ||||
$m_file = DEDEDATA.'/template.rand.txt'; | |||||
$m_file = DEDEDATA.'/template.rand.php'; | |||||
$okmsg = ''; | $okmsg = ''; | ||||
//保存配置 | //保存配置 | ||||
if ($dopost == 'save') { | if ($dopost == 'save') { | ||||
@@ -23,7 +22,7 @@ if ($dopost == 'save') { | |||||
flock($fp, 3); | flock($fp, 3); | ||||
fwrite($fp, $templates); | fwrite($fp, $templates); | ||||
fclose($fp); | fclose($fp); | ||||
$okmsg = Lang('article_template_rand_success_save'); | |||||
$okmsg = '成功保存配置信息 AT:('.MyDate('H:i:s', time()).')'; | |||||
} | } | ||||
//对旧文档进行随机模板处理 | //对旧文档进行随机模板处理 | ||||
else if ($dopost == 'makeold') { | else if ($dopost == 'makeold') { | ||||
@@ -31,43 +30,36 @@ else if ($dopost == 'makeold') { | |||||
set_time_limit(3600); | set_time_limit(3600); | ||||
if (!file_exists($m_file)) { | if (!file_exists($m_file)) { | ||||
AjaxHead(); | AjaxHead(); | ||||
echo Lang("article_template_rand_err_filenotexists"); | |||||
echo "配置文件不存在"; | |||||
exit(); | exit(); | ||||
} | } | ||||
$fileData = file_get_contents($m_file); | |||||
$arrs = preg_split("#[\t\r\n]#", $fileData); | |||||
$cfg_tamplate_arr = array(); | |||||
foreach ($arrs as $value) { | |||||
if (trim($value) !== "") { | |||||
$cfg_tamplate_arr[] = trim($value); | |||||
} | |||||
} | |||||
require_once($m_file); | |||||
if ($cfg_tamplate_rand == 0) { | if ($cfg_tamplate_rand == 0) { | ||||
AjaxHead(); | AjaxHead(); | ||||
echo Lang("article_template_rand_err_cfg"); | |||||
echo "系统没开启允许随机模板的选项"; | |||||
exit(); | exit(); | ||||
} | } | ||||
$totalTmp = count($cfg_tamplate_arr) - 1; | $totalTmp = count($cfg_tamplate_arr) - 1; | ||||
if ($totalTmp < 1) { | if ($totalTmp < 1) { | ||||
AjaxHead(); | AjaxHead(); | ||||
echo Lang("article_template_rand_err_tt"); | |||||
echo "随机模板的数量必须为2个或以上"; | |||||
exit(); | exit(); | ||||
} | } | ||||
for ($i = 0; $i < 10; $i++) { | for ($i = 0; $i < 10; $i++) { | ||||
$temp = $cfg_tamplate_arr[mt_rand(0, $totalTmp)]; | $temp = $cfg_tamplate_arr[mt_rand(0, $totalTmp)]; | ||||
$dsql->ExecuteNoneQuery("UPDATE `#@__addonarticle` set templet='$temp' where RIGHT(aid, 1)='$i'"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `#@__addonarticle` set templet='$temp' where RIGHT(aid, 1)='$i' "); | |||||
} | } | ||||
AjaxHead(); | AjaxHead(); | ||||
echo Lang("article_template_rand_success"); | |||||
echo "全部随机操作成功"; | |||||
exit(); | exit(); | ||||
} | } | ||||
//清除全部的指定模板 | //清除全部的指定模板 | ||||
else if ($dopost == 'clearold') { | else if ($dopost == 'clearold') { | ||||
CheckCSRF(); | CheckCSRF(); | ||||
$dsql->ExecuteNoneQuery("UPDATE `#@__addonarticle` set templet=''"); | |||||
$dsql->ExecuteNoneQuery(" OPTIMIZE TABLE `#@__addonarticle`"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `#@__addonarticle` set templet='' "); | |||||
$dsql->ExecuteNoneQuery(" OPTIMIZE TABLE `#@__addonarticle` "); | |||||
AjaxHead(); | AjaxHead(); | ||||
echo Lang("article_template_rand_success"); | |||||
echo "全部清除操作成功"; | |||||
exit(); | exit(); | ||||
} | } | ||||
//读出 | //读出 | ||||
@@ -76,11 +68,11 @@ if (empty($templates) && filesize($m_file) > 0) { | |||||
$templates = fread($fp, filesize($m_file)); | $templates = fread($fp, filesize($m_file)); | ||||
fclose($fp); | fclose($fp); | ||||
} | } | ||||
$wintitle = Lang("article_template_rand"); | |||||
$wecome_info = Lang("article_template_rand"); | |||||
$wintitle = "随机模板防采集设置"; | |||||
$wecome_info = "随机模板防采集设置"; | |||||
make_hash(); | make_hash(); | ||||
$msg = " | $msg = " | ||||
<link rel='stylesheet' href='../static/web/css/admin.min.css'> | |||||
<link rel='stylesheet' href='../static/web/css/admin.css'> | |||||
<script src='js/main.js'></script> | <script src='js/main.js'></script> | ||||
<script src='../static/web/js/webajax.js'></script> | <script src='../static/web/js/webajax.js'></script> | ||||
<script> | <script> | ||||
@@ -96,25 +88,27 @@ function DoRand(jobname) | |||||
} | } | ||||
</script> | </script> | ||||
<div id='loading' style='position:absolute;top:160;display:none;z-index:3000'> | <div id='loading' style='position:absolute;top:160;display:none;z-index:3000'> | ||||
<img src='../static/web/img/load.gif'>".Lang('article_template_rand_doing')." | |||||
<img src='../static/web/img/loadinglit.gif'>请稍后,正在操作中 | |||||
</div> | </div> | ||||
<table width='100%' align='center'> | <table width='100%' align='center'> | ||||
<tr> | <tr> | ||||
<td> | <td> | ||||
".Lang('article_template_rand_tip')." | |||||
<a href='javascript:;' onclick='DoRand(\"makeold\")' class='btn btn-success btn-sm'>".Lang('article_template_rand_makeold')."</a> | |||||
<a href='javascript:;' onclick='DoRand(\"clearold\")' class='btn btn-success btn-sm'>".Lang('article_template_rand_clearold')."</a> | |||||
<span id='tmpct' style='color:#dc3545;font-weight:bold'>$okmsg</span> | |||||
如果您想对旧的文档应用随机模板设置,请点击此对旧文档进行处理(必须设置好模板项) | |||||
<a href='javascript:;' onclick='DoRand(\"makeold\")' class='btn btn-success btn-sm'>设置全部</a> | |||||
<a href='javascript:;' onclick='DoRand(\"clearold\")' class='btn btn-success btn-sm'>取消全部</a> | |||||
<span id='tmpct'>$okmsg</span> | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td><textarea name='templates' id='templates' style='width:100%;height:250px'>$templates</textarea></td> | <td><textarea name='templates' id='templates' style='width:100%;height:250px'>$templates</textarea></td> | ||||
</tr> | </tr> | ||||
</table>"; | </table>"; | ||||
DedeWin::Instance()->Init('article_template_rand.php', 'js/blank.js', 'POST') | |||||
->AddHidden('dopost', 'save') | |||||
->AddHidden('token', $_SESSION['token']) | |||||
->AddTitle(Lang("article_template_rand_title")) | |||||
->AddMsgItem($msg) | |||||
->GetWindow('ok')->Display(); | |||||
$win = new OxWindow(); | |||||
$win->Init('article_template_rand.php', 'js/blank.js', 'POST'); | |||||
$win->AddHidden('dopost', 'save'); | |||||
$win->AddHidden('token', $_SESSION['token']); | |||||
$win->AddTitle("本设置仅适用于系统默认的文档模型,设置后发布文档时会自动按指定的模板随机获取一个,如果不想使用此功能,把它设置为空即可"); | |||||
$win->AddMsgItem($msg); | |||||
$winform = $win->GetWindow('ok'); | |||||
$win->Display(); | |||||
?> | ?> |
@@ -8,17 +8,16 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
@set_time_limit(0); | @set_time_limit(0); | ||||
UserLogin::CheckPurview('sys_ArcBatch'); | |||||
CheckPurview('sys_ArcBatch'); | |||||
if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
if ($dopost == 'analyse') { | if ($dopost == 'analyse') { | ||||
$arr = $dsql->getone("SELECT maintable FROM `#@__channeltype` WHERE id='$channelid'"); | |||||
$arr = $dsql->getone("SELECT maintable FROM `#@__channeltype` WHERE id='$channelid' "); | |||||
if (is_array($arr)) { | if (is_array($arr)) { | ||||
$maintable = $arr['maintable']; | $maintable = $arr['maintable']; | ||||
} else { | } else { | ||||
showmsg(Lang('article_test_same_err_id'), 'javascript:;'); | |||||
showmsg('频道id不正确,无法处理', 'javascript:;'); | |||||
exit(); | exit(); | ||||
} | } | ||||
$dsql->SetQuery("SELECT COUNT(title) AS dd,title FROM `$maintable` WHERE channel='$channelid' GROUP BY title ORDER BY dd DESC LIMIT 0, $pagesize"); | $dsql->SetQuery("SELECT COUNT(title) AS dd,title FROM `$maintable` WHERE channel='$channelid' GROUP BY title ORDER BY dd DESC LIMIT 0, $pagesize"); | ||||
@@ -27,13 +26,14 @@ if ($dopost == 'analyse') { | |||||
include DedeInclude('templets/article_result_same.htm'); | include DedeInclude('templets/article_result_same.htm'); | ||||
exit(); | exit(); | ||||
} | } | ||||
//删除选中的内容,只保留一条 | |||||
//删除选中的内容(只保留一条) | |||||
else if ($dopost == 'delsel') { | else if ($dopost == 'delsel') { | ||||
require_once(DEDEINC."/typelink/typelink.class.php"); | |||||
require_once(dirname(__FILE__)."/inc/inc_batchup.php"); | require_once(dirname(__FILE__)."/inc/inc_batchup.php"); | ||||
if (empty($titles)) { | if (empty($titles)) { | ||||
header("Content-Type: text/html; charset={$cfg_ver_lang}"); | header("Content-Type: text/html; charset={$cfg_ver_lang}"); | ||||
echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset={$cfg_ver_lang}\">\r\n"; | echo "<meta http-equiv=\"Content-Type\" content=\"text/html; charset={$cfg_ver_lang}\">\r\n"; | ||||
echo Lang("article_test_same_err_noarticle"); | |||||
echo "没有指定删除的文档"; | |||||
exit(); | exit(); | ||||
} | } | ||||
$titless = split('`', $titles); | $titless = split('`', $titles); | ||||
@@ -47,9 +47,9 @@ else if ($dopost == 'delsel') { | |||||
$title = trim($title); | $title = trim($title); | ||||
$title = addslashes($title == '' ? '' : urldecode($title)); | $title = addslashes($title == '' ? '' : urldecode($title)); | ||||
if ($channelid < -1) { | if ($channelid < -1) { | ||||
$q1 = "SELECT aid as id,title FROM `$maintable` WHERE channel='$channelid' AND title='$title' $orderby"; | |||||
$q1 = "SELECT aid as id,title FROM `$maintable` WHERE channel='$channelid' AND title='$title' $orderby "; | |||||
} else { | } else { | ||||
$q1 = "SELECT id,title FROM `$maintable` WHERE channel='$channelid' AND title='$title' $orderby"; | |||||
$q1 = "SELECT id,title FROM `$maintable` WHERE channel='$channelid' AND title='$title' $orderby "; | |||||
} | } | ||||
$dsql->SetQuery($q1); | $dsql->SetQuery($q1); | ||||
$dsql->Execute(); | $dsql->Execute(); | ||||
@@ -65,13 +65,13 @@ else if ($dopost == 'delsel') { | |||||
DelArc($naid, 'OFF'); | DelArc($naid, 'OFF'); | ||||
} | } | ||||
} | } | ||||
$dsql->ExecuteNoneQuery("OPTIMIZE TABLE `$maintable`;"); | |||||
ShowMsg(Lang('article_test_same_delete_success',array('totalarc'=>$totalarc)), "javascript:;"); | |||||
$dsql->ExecuteNoneQuery(" OPTIMIZE TABLE `$maintable`; "); | |||||
ShowMsg("一共删除了 [{$totalarc}] 篇重复的文档", "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
//向导页 | //向导页 | ||||
$channelinfos = array(); | $channelinfos = array(); | ||||
$dsql->setquery("SELECT id,typename,maintable,addtable FROM `#@__channeltype`"); | |||||
$dsql->setquery("SELECT id,typename,maintable,addtable FROM `#@__channeltype` "); | |||||
$dsql->execute(); | $dsql->execute(); | ||||
while ($row = $dsql->getarray()) $channelinfos[] = $row; | while ($row = $dsql->getarray()) $channelinfos[] = $row; | ||||
include DedeInclude('templets/article_test_same.htm'); | include DedeInclude('templets/article_test_same.htm'); |
@@ -8,10 +8,9 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DedeWin; | |||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__).'/config.php'); | require_once(dirname(__FILE__).'/config.php'); | ||||
UserLogin::CheckPurview('sys_Writer'); | |||||
require_once(DEDEINC.'/libraries/oxwindow.class.php'); | |||||
CheckPurview('sys_Writer'); | |||||
if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
if (empty($allwriter)) $allwriter = ''; | if (empty($allwriter)) $allwriter = ''; | ||||
else $allwriter = stripslashes($allwriter); | else $allwriter = stripslashes($allwriter); | ||||
@@ -30,11 +29,13 @@ if (empty($allwriter) && filesize($m_file) > 0) { | |||||
$allwriter = fread($fp, filesize($m_file)); | $allwriter = fread($fp, filesize($m_file)); | ||||
fclose($fp); | fclose($fp); | ||||
} | } | ||||
$wintitle = Lang("content_writer_main"); | |||||
$wecome_info = Lang("content_writer_main"); | |||||
DedeWin::Instance()->Init('article_writer_edit.php', 'js/blank.js', 'POST') | |||||
->AddHidden('dopost', 'save') | |||||
->AddTitle(Lang("content_writer_main_title")) | |||||
->AddMsgItem("<textarea name='allwriter' id='allwriter' style='width:100%;height:300px'>$allwriter</textarea>") | |||||
->GetWindow('ok')->Display(); | |||||
$wintitle = "文档作者管理"; | |||||
$wecome_info = "文档作者管理"; | |||||
$win = new OxWindow(); | |||||
$win->Init('article_writer_edit.php', 'js/blank.js', 'POST'); | |||||
$win->AddHidden('dopost', 'save'); | |||||
$win->AddTitle("把作者姓名用半角逗号“,”分开:"); | |||||
$win->AddMsgItem("<textarea name='allwriter' id='allwriter' style='width:100%;height:300px'>$allwriter</textarea>"); | |||||
$winform = $win->GetWindow('ok'); | |||||
$win->Display(); | |||||
?> | ?> |
@@ -8,16 +8,15 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('member_Card'); | |||||
CheckPurview('member_Card'); | |||||
if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
if ($dopost == '') include(DEDEADMIN."/templets/cards_make.htm"); | if ($dopost == '') include(DEDEADMIN."/templets/cards_make.htm"); | ||||
//生成点卡 | //生成点卡 | ||||
elseif ($dopost == 'make') { | elseif ($dopost == 'make') { | ||||
$row = $dsql->GetOne("SELECT * FROM `#@__moneycard_record` ORDER BY aid DESC"); | |||||
$row = $dsql->GetOne("SELECT * FROM #@__moneycard_record ORDER BY aid DESC"); | |||||
!is_array($row) ? $startid = 100000 : $startid = $row['aid'] + 100000; | !is_array($row) ? $startid = 100000 : $startid = $row['aid'] + 100000; | ||||
$row = $dsql->GetOne("SELECT * FROM `#@__moneycard_type` WHERE tid='$cardtype'"); | |||||
$row = $dsql->GetOne("SELECT * FROM #@__moneycard_type WHERE tid='$cardtype'"); | |||||
$money = $row['money']; | $money = $row['money']; | ||||
$num = $row['num']; | $num = $row['num']; | ||||
$mtime = time(); | $mtime = time(); | ||||
@@ -25,7 +24,7 @@ elseif ($dopost == 'make') { | |||||
$ctid = $cardtype; | $ctid = $cardtype; | ||||
$startid++; | $startid++; | ||||
$endid = $startid + $mnum; | $endid = $startid + $mnum; | ||||
header("Content-Type: text/html; charset=utf-8"); | |||||
header("Content-Type: text/html; charset={$cfg_soft_lang}"); | |||||
for (; $startid < $endid; $startid++) { | for (; $startid < $endid; $startid++) { | ||||
$cardid = $snprefix.$startid.'-'; | $cardid = $snprefix.$startid.'-'; | ||||
for ($p = 0; $p < $pwdgr; $p++) { | for ($p = 0; $p < $pwdgr; $p++) { | ||||
@@ -47,10 +46,10 @@ elseif ($dopost == 'make') { | |||||
$cardid .= '-'; | $cardid .= '-'; | ||||
} | } | ||||
} | } | ||||
$inquery = "INSERT INTO `#@__moneycard_record`(ct_id,cardid,uid,isexp,mtime,utime,money,num) VALUES ('$ctid','$cardid','0','0','$mtime','$utime','$money','$num');"; | |||||
$inquery = "INSERT INTO `#@__moneycard_record` (ctid,cardid,uid,isexp,mtime,utime,money,num) VALUES ('$ctid','$cardid','0','0','$mtime','$utime','$money','$num'); "; | |||||
$dsql->ExecuteNoneQuery($inquery); | $dsql->ExecuteNoneQuery($inquery); | ||||
echo Lang('cards_make_success',array('cardid'=>$cardid)); | |||||
echo "成功生成点卡:{$cardid}<br>"; | |||||
} | } | ||||
echo Lang('cards_make_success_1',array("mnum"=>$mnum)); | |||||
echo "成功生成 {$mnum} 个点卡"; | |||||
} | } | ||||
?> | ?> |
@@ -8,28 +8,28 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DataListCP; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
require_once(DEDEINC.'/datalistcp.class.php'); | |||||
$dopost = empty($dopost) ? "" : $dopost; | $dopost = empty($dopost) ? "" : $dopost; | ||||
if ($dopost == "delete") { | if ($dopost == "delete") { | ||||
$ids = explode('`', $aids); | $ids = explode('`', $aids); | ||||
$dquery = ""; | $dquery = ""; | ||||
foreach ($ids as $id) { | foreach ($ids as $id) { | ||||
if ($dquery == "") $dquery .= "aid='$id'"; | |||||
else $dquery .= "OR aid='$id'"; | |||||
if ($dquery == "") $dquery .= "aid='$id' "; | |||||
else $dquery .= " OR aid='$id' "; | |||||
} | } | ||||
if ($dquery != "") $dquery = " WHERE ".$dquery; | if ($dquery != "") $dquery = " WHERE ".$dquery; | ||||
$dsql->ExecuteNoneQuery("DELETE FROM `#@__moneycard_record` $dquery"); | |||||
ShowMsg(Lang("content_delete_success"), "cards_manage.php"); | |||||
$dsql->ExecuteNoneQuery("DELETE FROM #@__moneycard_record $dquery"); | |||||
ShowMsg("成功删除指定的记录", "cards_manage.php"); | |||||
exit(); | exit(); | ||||
} else { | } else { | ||||
$addsql = ''; | $addsql = ''; | ||||
if (isset($isexp)) $addsql = "WHERE isexp='$isexp'"; | |||||
$sql = "SELECT * FROM `#@__moneycard_record` $addsql ORDER BY aid DESC"; | |||||
if (isset($isexp)) $addsql = " WHERE isexp='$isexp' "; | |||||
$sql = "SELECT * FROM #@__moneycard_record $addsql ORDER BY aid DESC"; | |||||
$dlist = new DataListCP(); | $dlist = new DataListCP(); | ||||
$dlist->pagesize = 30;//设定每页显示记录数 | $dlist->pagesize = 30;//设定每页显示记录数 | ||||
if (isset($isexp)) $dlist->SetParameter("isexp", $isexp); | if (isset($isexp)) $dlist->SetParameter("isexp", $isexp); | ||||
$dlist->dsql->SetQuery("SELECT * FROM `#@__moneycard_type`"); | |||||
$dlist->dsql->SetQuery("SELECT * FROM #@__moneycard_type "); | |||||
$dlist->dsql->Execute('ts'); | $dlist->dsql->Execute('ts'); | ||||
while ($rw = $dlist->dsql->GetArray('ts')) { | while ($rw = $dlist->dsql->GetArray('ts')) { | ||||
$TypeNames[$rw['tid']] = $rw['pname']; | $TypeNames[$rw['tid']] = $rw['pname']; | ||||
@@ -44,19 +44,19 @@ function GetMemberID($mid) | |||||
{ | { | ||||
global $dsql; | global $dsql; | ||||
if ($mid == 0) return '0'; | if ($mid == 0) return '0'; | ||||
$row = $dsql->GetOne("SELECT userid FROM `#@__member` WHERE mid='$mid'"); | |||||
$row = $dsql->GetOne("SELECT userid FROM #@__member WHERE mid='$mid' "); | |||||
if (is_array($row)) return "<a href='member_view.php?mid={$mid}'>".$row['userid']."</a>"; | if (is_array($row)) return "<a href='member_view.php?mid={$mid}'>".$row['userid']."</a>"; | ||||
else return '0'; | else return '0'; | ||||
} | } | ||||
function GetUseDate($time = 0) | function GetUseDate($time = 0) | ||||
{ | { | ||||
if (!empty($time)) return GetDateMk($time); | if (!empty($time)) return GetDateMk($time); | ||||
else return Lang('cards_stat_0'); | |||||
else return '未使用'; | |||||
} | } | ||||
function GetSta($sta) | function GetSta($sta) | ||||
{ | { | ||||
if ($sta == 1) return Lang('cards_stat_1'); | |||||
else if ($sta == -1) return Lang('cards_stat_-1'); | |||||
else return Lang('cards_stat_0'); | |||||
if ($sta == 1) return '已售出'; | |||||
else if ($sta == -1) return '已使用'; | |||||
else return '未使用'; | |||||
} | } | ||||
?> | ?> |
@@ -8,10 +8,10 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__).'/config.php'); | require_once(dirname(__FILE__).'/config.php'); | ||||
UserLogin::CheckPurview('member_Type'); | |||||
CheckPurview('member_Type'); | |||||
if (empty($dopost)) $dopost = ""; | if (empty($dopost)) $dopost = ""; | ||||
//保存修改 | //保存修改 | ||||
if ($dopost == "save") { | if ($dopost == "save") { | ||||
$startID = 1; | $startID = 1; | ||||
@@ -26,23 +26,24 @@ if ($dopost == "save") { | |||||
if ($pname != '') { | if ($pname != '') { | ||||
$query = "UPDATE `#@__moneycard_type` SET pname='$pname',money='$money',num='$num' WHERE tid='$tid'"; | $query = "UPDATE `#@__moneycard_type` SET pname='$pname',money='$money',num='$num' WHERE tid='$tid'"; | ||||
$dsql->ExecuteNoneQuery($query); | $dsql->ExecuteNoneQuery($query); | ||||
$query = "UPDATE `#@__moneycard_record` SET money='$money',num='$num' WHERE ct_id='$tid';"; | |||||
$query = "UPDATE `#@__moneycard_record` SET money='$money',num='$num' WHERE ctid='$tid' ; "; | |||||
$dsql->ExecuteNoneQuery($query); | $dsql->ExecuteNoneQuery($query); | ||||
} | } | ||||
} else { | } else { | ||||
$query = "DELETE FROM `#@__moneycard_type` WHERE tid='$tid'"; | |||||
$query = "DELETE FROM `#@__moneycard_type` WHERE tid='$tid' "; | |||||
$dsql->ExecuteNoneQuery($query); | $dsql->ExecuteNoneQuery($query); | ||||
$query = "DELETE FROM `#@__moneycard_record` WHERE ct_id='$tid' AND isexp<>-1;"; | |||||
$query = "DELETE FROM `#@__moneycard_record` WHERE ctid='$tid' AND isexp<>-1 ; "; | |||||
$dsql->ExecuteNoneQuery($query); | $dsql->ExecuteNoneQuery($query); | ||||
} | } | ||||
} | } | ||||
//增加新记录 | //增加新记录 | ||||
if (isset($check_new) && $pname_new != '') { | if (isset($check_new) && $pname_new != '') { | ||||
$query = "INSERT INTO `#@__moneycard_type`(num,pname,money) VALUES ('{$num_new}','{$pname_new}','{$money_new}');"; | |||||
$query = "INSERT INTO `#@__moneycard_type` (num,pname,money) VALUES ('{$num_new}','{$pname_new}','{$money_new}');"; | |||||
$dsql->ExecuteNoneQuery($query); | $dsql->ExecuteNoneQuery($query); | ||||
} | } | ||||
header("Content-Type: text/html; charset=utf-8"); | |||||
echo "<script> alert('".Lang('cards_success_save')."'); </script>"; | |||||
header("Content-Type: text/html; charset={$cfg_soft_lang}"); | |||||
echo "<script> alert('成功更新点卡产品分类表'); </script>"; | |||||
} | } | ||||
require_once(DEDEADMIN."/templets/cards_type.htm"); | require_once(DEDEADMIN."/templets/cards_type.htm"); | ||||
?> | ?> |
@@ -8,9 +8,8 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
use DedeBIZ\TypeLink\TypeLink; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
require_once(DEDEINC."/typelink/typelink.class.php"); | |||||
if (empty($listtype)) $listtype = ''; | if (empty($listtype)) $listtype = ''; | ||||
if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
if (empty($upinyin)) $upinyin = 0; | if (empty($upinyin)) $upinyin = 0; | ||||
@@ -20,11 +19,11 @@ $id = empty($id) ? 0 : intval($id); | |||||
$reid = empty($reid) ? 0 : intval($reid); | $reid = empty($reid) ? 0 : intval($reid); | ||||
$nid = 'article'; | $nid = 'article'; | ||||
if ($id == 0 && $reid == 0) { | if ($id == 0 && $reid == 0) { | ||||
UserLogin::CheckPurview('t_New'); | |||||
CheckPurview('t_New'); | |||||
} else { | } else { | ||||
$checkID = empty($id) ? $reid : $id; | $checkID = empty($id) ? $reid : $id; | ||||
UserLogin::CheckPurview('t_AccNew'); | |||||
UserLogin::CheckCatalog($checkID, Lang('catalog_err_addsub')); | |||||
CheckPurview('t_AccNew'); | |||||
CheckCatalog($checkID, '您无权在本栏目下创建子类'); | |||||
} | } | ||||
if (empty($myrow)) $myrow = array(); | if (empty($myrow)) $myrow = array(); | ||||
$dsql->SetQuery("SELECT id,typename,nid FROM `#@__channeltype` WHERE id<>-1 AND isshow=1 ORDER BY id"); | $dsql->SetQuery("SELECT id,typename,nid FROM `#@__channeltype` WHERE id<>-1 AND isshow=1 ORDER BY id"); | ||||
@@ -42,13 +41,16 @@ if ($dopost == 'quick') { | |||||
include DedeInclude('templets/catalog_add_quick.htm'); | include DedeInclude('templets/catalog_add_quick.htm'); | ||||
exit(); | exit(); | ||||
} | } | ||||
/*--------------------- | |||||
function action_savequick(){ } | |||||
---------------------*/ | |||||
else if ($dopost == 'savequick') { | else if ($dopost == 'savequick') { | ||||
if (!isset($savetype)) $savetype = ''; | if (!isset($savetype)) $savetype = ''; | ||||
$isdefault = isset($isdefault) ? $isdefault : 0; | $isdefault = isset($isdefault) ? $isdefault : 0; | ||||
$tempindex = "{style}/index_{$nid}.htm"; | $tempindex = "{style}/index_{$nid}.htm"; | ||||
$templist = "{style}/list_{$nid}.htm"; | $templist = "{style}/list_{$nid}.htm"; | ||||
$temparticle = "{style}/article_{$nid}.htm"; | $temparticle = "{style}/article_{$nid}.htm"; | ||||
$queryTemplate = "INSERT INTO `#@__arctype`(reid,topid,sortrank,typename,cnoverview,enname,enoverview,bigpic,litimg,typedir,isdefault,defaultname,issend,channeltype,tempindex,templist,temparticle,modname,namerule,namerule2,ispart,corank,description,keywords,seotitle,moresite,siteurl,sitepath,ishidden,`iscross`,`crossid`,`content`,`smalltypes`) VALUES ('~reid~','~topid~','~rank~','~typename~','','','','','','~typedir~','$isdefault','$defaultname','$issend','$channeltype','$tempindex','$templist','$temparticle','default','$namerule','$namerule2','0','0','','','~typename~','0','','','0','0','0','','')"; | |||||
$queryTemplate = "INSERT INTO `#@__arctype` (reid,topid,sortrank,typename,cnoverview,enname,enoverview,bigpic,litimg,typedir,isdefault,defaultname,issend,channeltype,tempindex,templist,temparticle,modname,namerule,namerule2,ispart,corank,description,keywords,seotitle,moresite,siteurl,sitepath,ishidden,`cross`,`crossid`,`content`,`smalltypes`) VALUES ('~reid~','~topid~','~rank~','~typename~','','','','','','~typedir~','$isdefault','$defaultname','$issend','$channeltype','$tempindex','$templist','$temparticle','default','$namerule','$namerule2','0','0','','','~typename~','0','','','0','0','0','','')"; | |||||
if (empty($savetype)) { | if (empty($savetype)) { | ||||
foreach ($_POST as $k => $v) { | foreach ($_POST as $k => $v) { | ||||
if (preg_match("#^posttype#", $k)) { | if (preg_match("#^posttype#", $k)) { | ||||
@@ -122,9 +124,12 @@ else if ($dopost == 'savequick') { | |||||
} | } | ||||
} | } | ||||
UpDateCatCache(); | UpDateCatCache(); | ||||
ShowMsg(Lang('catalog_quickadd_success'), 'catalog_main.php'); | |||||
ShowMsg('成功增加指定栏目', 'catalog_main.php'); | |||||
exit(); | exit(); | ||||
} | } | ||||
/*--------------------- | |||||
function action_save(){ } | |||||
---------------------*/ | |||||
else if ($dopost == 'save') { | else if ($dopost == 'save') { | ||||
$smalltypes = ''; | $smalltypes = ''; | ||||
if (empty($smalltype)) $smalltype = ''; | if (empty($smalltype)) $smalltype = ''; | ||||
@@ -134,7 +139,6 @@ else if ($dopost == 'save') { | |||||
if ($ispart != 0) $cross = 0; | if ($ispart != 0) $cross = 0; | ||||
$description = Html2Text($description, 1); | $description = Html2Text($description, 1); | ||||
$keywords = Html2Text($keywords, 1); | $keywords = Html2Text($keywords, 1); | ||||
$sortrank = empty($sortrank)? 0 : $sortrank; | |||||
if ($ispart != 2) { | if ($ispart != 2) { | ||||
//栏目的参照目录 | //栏目的参照目录 | ||||
if ($referpath == 'cmspath') $nextdir = '{cmspath}'; | if ($referpath == 'cmspath') $nextdir = '{cmspath}'; | ||||
@@ -152,12 +156,12 @@ else if ($dopost == 'save') { | |||||
//检测二级网址 | //检测二级网址 | ||||
if ($siteurl != '') { | if ($siteurl != '') { | ||||
$siteurl = preg_replace("#\/$#", "", $siteurl); | $siteurl = preg_replace("#\/$#", "", $siteurl); | ||||
if (!preg_match("#(http|https):\/\/#i", $siteurl)) { | |||||
ShowMsg(Lang("catalog_err_site_url"), "-1"); | |||||
if (!preg_match("#http:\/\/#i", $siteurl)) { | |||||
ShowMsg("您绑定的二级域名无效,请用(http://host)的形式", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (preg_match("#".$cfg_basehost."#i", $siteurl)) { | if (preg_match("#".$cfg_basehost."#i", $siteurl)) { | ||||
ShowMsg(Lang("catalog_err_site_same"), "-1"); | |||||
ShowMsg("您绑定的二级域名与当前站点是同一个域,不需要绑定", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
} | } | ||||
@@ -167,20 +171,20 @@ else if ($dopost == 'save') { | |||||
$true_typedir = str_replace("{cmspath}", $cfg_cmspath, $typedir); | $true_typedir = str_replace("{cmspath}", $cfg_cmspath, $typedir); | ||||
$true_typedir = preg_replace("#\/{1,}#", "/", $true_typedir); | $true_typedir = preg_replace("#\/{1,}#", "/", $true_typedir); | ||||
if (!CreateDir($true_typedir)) { | if (!CreateDir($true_typedir)) { | ||||
ShowMsg(Lang("catalog_err_create",array('true_typedir'=>$true_typedir)), "-1"); | |||||
ShowMsg("创建目录 {$true_typedir} 失败,请检查您的路径是否存在问题", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
} | } | ||||
$in_query = "INSERT INTO `#@__arctype`(reid,topid,sortrank,typename,cnoverview,enname,enoverview,bigpic,litimg,typedir,isdefault,defaultname,issend,channeltype,tempindex,templist,temparticle,modname,namerule,namerule2,ispart,corank,description,keywords,seotitle,moresite,siteurl,sitepath,ishidden,`iscross`,`crossid`,`content`,`smalltypes`) VALUES ('$reid','$topid','$sortrank','$typename','$cnoverview','$enname','$enoverview','$bigpic','$litimg','$typedir','$isdefault','$defaultname','$issend','$channeltype','$tempindex','$templist','$temparticle','default','$namerule','$namerule2','$ispart','$corank','$description','$keywords','$seotitle','$moresite','$siteurl','$sitepath','$ishidden','$cross','$crossid','$content','$smalltypes')"; | |||||
$in_query = "INSERT INTO `#@__arctype` (reid,topid,sortrank,typename,cnoverview,enname,enoverview,bigpic,litimg,typedir,isdefault,defaultname,issend,channeltype,tempindex,templist,temparticle,modname,namerule,namerule2,ispart,corank,description,keywords,seotitle,moresite,siteurl,sitepath,ishidden,`cross`,`crossid`,`content`,`smalltypes`) VALUES ('$reid','$topid','$sortrank','$typename','$cnoverview','$enname','$enoverview','$bigpic','$litimg','$typedir','$isdefault','$defaultname','$issend','$channeltype','$tempindex','$templist','$temparticle','default','$namerule','$namerule2','$ispart','$corank','$description','$keywords','$seotitle','$moresite','$siteurl','$sitepath','$ishidden','$cross','$crossid','$content','$smalltypes')"; | |||||
if (!$dsql->ExecuteNoneQuery($in_query)) { | if (!$dsql->ExecuteNoneQuery($in_query)) { | ||||
ShowMsg(Lang("catalog_err_save"), "-1"); | |||||
ShowMsg("保存目录数据时失败,请检查您的输入资料是否存在问题", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
UpDateCatCache(); | UpDateCatCache(); | ||||
if ($reid > 0) { | if ($reid > 0) { | ||||
PutCookie('lastCid', GetTopid($reid), 3600 * 24, '/'); | PutCookie('lastCid', GetTopid($reid), 3600 * 24, '/'); | ||||
} | } | ||||
ShowMsg(Lang("catalog_success_save"), "catalog_main.php"); | |||||
ShowMsg("成功创建一个分类", "catalog_main.php"); | |||||
exit(); | exit(); | ||||
}//End dopost==save | }//End dopost==save | ||||
//获取从父目录继承的默认参数 | //获取从父目录继承的默认参数 | ||||
@@ -193,7 +197,7 @@ if ($dopost == '') { | |||||
$typedir = ''; | $typedir = ''; | ||||
$moresite = 0; | $moresite = 0; | ||||
if ($id > 0) { | if ($id > 0) { | ||||
$myrow = $dsql->GetOne("SELECT tp.*,ch.typename AS ctypename FROM `#@__arctype` tp LEFT JOIN `#@__channeltype` ch ON ch.id=tp.channeltype WHERE tp.id=$id"); | |||||
$myrow = $dsql->GetOne("SELECT tp.*,ch.typename AS ctypename FROM `#@__arctype` tp LEFT JOIN `#@__channeltype` ch ON ch.id=tp.channeltype WHERE tp.id=$id "); | |||||
$channelid = $myrow['channeltype']; | $channelid = $myrow['channeltype']; | ||||
$issennd = $myrow['issend']; | $issennd = $myrow['issend']; | ||||
$corank = $myrow['corank']; | $corank = $myrow['corank']; | ||||
@@ -8,32 +8,33 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DedeWin; | |||||
use DedeBIZ\Login\UserLogin; | |||||
use DedeBIZ\TypeLink\TypeUnitAdmin; | |||||
require_once(dirname(__FILE__).'/config.php'); | require_once(dirname(__FILE__).'/config.php'); | ||||
//检查权限许可 | //检查权限许可 | ||||
UserLogin::CheckPurview('t_Del,t_AccDel'); | |||||
CheckPurview('t_Del,t_AccDel'); | |||||
require_once(DEDEINC.'/typelink/typeunit.class.admin.php'); | |||||
require_once(DEDEINC.'/libraries/oxwindow.class.php'); | |||||
$id = trim(preg_replace("#[^0-9]#", '', $id)); | $id = trim(preg_replace("#[^0-9]#", '', $id)); | ||||
//检查栏目操作许可 | //检查栏目操作许可 | ||||
UserLogin::CheckCatalog($id, Lang("catalog_err_delete_noperm")); | |||||
CheckCatalog($id, "您无权删除本栏目"); | |||||
if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
if ($dopost == 'ok') { | if ($dopost == 'ok') { | ||||
$ut = new TypeUnitAdmin(); | |||||
$ut = new TypeUnit(); | |||||
$ut->DelType($id, $delfile); | $ut->DelType($id, $delfile); | ||||
UpDateCatCache(); | UpDateCatCache(); | ||||
ShowMsg(Lang("catalog_success_delete"), "catalog_main.php"); | |||||
ShowMsg("成功删除一个栏目", "catalog_main.php"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$dsql->SetQuery("SELECT typename,typedir FROM `#@__arctype` WHERE id=".$id); | |||||
$dsql->SetQuery("SELECT typename,typedir FROM #@__arctype WHERE id=".$id); | |||||
$row = $dsql->GetOne(); | $row = $dsql->GetOne(); | ||||
$wintitle = Lang("catalog_delete_confirm"); | |||||
$wecome_info = "<a href='catalog_main.php'>".Lang('catalog_main')."</a> > ".Lang("catalog_delete_confirm"); | |||||
DedeWin::Instance()->Init('catalog_del.php', 'js/blank.js', 'POST') | |||||
->AddHidden('id', $id) | |||||
->AddHidden('dopost', 'ok') | |||||
->AddTitle(Lang('catalog_delete_confirm_title',array('typename'=>$row['typename']))) | |||||
->AddItem(Lang('catalog_delete_typedir'), $row['typedir']) | |||||
->AddItem(Lang('catalog_delete_file'), "<label><input type='radio' name='delfile' value='no' checked='1'> ".Lang("no")."</label> <label><input type='radio' name='delfile' value='yes'> ".Lang("yes")."</label>") | |||||
->GetWindow('ok')->Display(); | |||||
$wintitle = "删除栏目确认"; | |||||
$wecome_info = "<a href='catalog_main.php'>栏目管理</a> > 删除栏目确认"; | |||||
$win = new OxWindow(); | |||||
$win->Init('catalog_del.php', 'js/blank.js', 'POST'); | |||||
$win->AddHidden('id', $id); | |||||
$win->AddHidden('dopost', 'ok'); | |||||
$win->AddTitle("您要确定要删除栏目:[{$row['typename']}] 吗"); | |||||
$win->AddItem('栏目的文件保存目录:', $row['typedir']); | |||||
$win->AddItem('是否删除文件:', "<label><input type='radio' name='delfile' value='no' checked='1'> 否</label> <label><input type='radio' name='delfile' value='yes'> 是</label>"); | |||||
$winform = $win->GetWindow('ok'); | |||||
$win->Display(); | |||||
?> | ?> |
@@ -8,21 +8,18 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Archive\ListView; | |||||
use DedeBIZ\libraries\DedeWin; | |||||
use DedeBIZ\Login\UserLogin; | |||||
use DedeBIZ\TypeLink\TypeLink; | |||||
use DedeBIZ\TypeLink\TypeUnitAdmin; | |||||
use DedeBIZ\TypeLink\TypeUnitMenu; | |||||
require_once(dirname(__FILE__).'/config.php'); | require_once(dirname(__FILE__).'/config.php'); | ||||
if (empty($dopost)) { | if (empty($dopost)) { | ||||
ShowMsg(Lang("dopost_error_noparms"), "catalog_main.php"); | |||||
ShowMsg("对不起,请指定栏目参数", "catalog_main.php"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$cid = empty($cid) ? 0 : intval($cid); | $cid = empty($cid) ? 0 : intval($cid); | ||||
$unittype = empty($unittype) ? 0 : intval($unittype); | $unittype = empty($unittype) ? 0 : intval($unittype); | ||||
$channelid = empty($channelid) ? 0 : intval($channelid); | $channelid = empty($channelid) ? 0 : intval($channelid); | ||||
/*-------------------------- | |||||
//增加文档 | //增加文档 | ||||
function addArchives(); | |||||
---------------------------*/ | |||||
if ($dopost == "addArchives") { | if ($dopost == "addArchives") { | ||||
//默认文档调用发布表单 | //默认文档调用发布表单 | ||||
if (empty($cid) && empty($channelid)) { | if (empty($cid) && empty($channelid)) { | ||||
@@ -34,18 +31,22 @@ if ($dopost == "addArchives") { | |||||
$row = $dsql->GetOne("SELECT addcon FROM `#@__channeltype` WHERE id='$channelid'"); | $row = $dsql->GetOne("SELECT addcon FROM `#@__channeltype` WHERE id='$channelid'"); | ||||
} else { | } else { | ||||
//根据栏目调用发布表单 | //根据栏目调用发布表单 | ||||
$row = $dsql->GetOne("SELECT ch.addcon FROM `#@__arctype` tp LEFT JOIN `#@__channeltype` ch ON ch.id=tp.channeltype WHERE tp.id='$cid'"); | |||||
$row = $dsql->GetOne("SELECT ch.addcon FROM `#@__arctype` tp LEFT JOIN `#@__channeltype` ch ON ch.id=tp.channeltype WHERE tp.id='$cid' "); | |||||
} | } | ||||
$gurl = $row["addcon"]; | $gurl = $row["addcon"]; | ||||
if ($gurl == "") { | if ($gurl == "") { | ||||
ShowMsg(Lang("dopost_error_typelink"), "catalog_main.php"); | |||||
ShowMsg("对不起,您指的栏目可能有误", "catalog_main.php"); | |||||
exit(); | exit(); | ||||
} | } | ||||
//跳转并传递参数 | //跳转并传递参数 | ||||
header("location:{$gurl}?channelid={$channelid}&cid={$cid}"); | header("location:{$gurl}?channelid={$channelid}&cid={$cid}"); | ||||
exit(); | exit(); | ||||
} | } | ||||
/*-------------------------- | |||||
//管理文档 | //管理文档 | ||||
function listArchives(); | |||||
---------------------------*/ | |||||
else if ($dopost == "listArchives") { | else if ($dopost == "listArchives") { | ||||
if (!empty($gurl)) { | if (!empty($gurl)) { | ||||
if (empty($arcrank)) { | if (empty($arcrank)) { | ||||
@@ -62,7 +63,7 @@ else if ($dopost == "listArchives") { | |||||
$typename = $row["typename"]; | $typename = $row["typename"]; | ||||
$channelname = $row["channelname"]; | $channelname = $row["channelname"]; | ||||
if ($gurl == "") { | if ($gurl == "") { | ||||
ShowMsg(Lang("dopost_error_typelink"), "catalog_main.php"); | |||||
ShowMsg("对不起,您指的栏目可能有误", "catalog_main.php"); | |||||
exit(); | exit(); | ||||
} | } | ||||
} else if ($channelid > 0) { | } else if ($channelid > 0) { | ||||
@@ -77,38 +78,48 @@ else if ($dopost == "listArchives") { | |||||
header("location:{$gurl}?channelid={$channelid}&cid={$cid}"); | header("location:{$gurl}?channelid={$channelid}&cid={$cid}"); | ||||
exit(); | exit(); | ||||
} | } | ||||
/*-------------------------- | |||||
//浏览通用模板目录 | //浏览通用模板目录 | ||||
function viewTempletDir(); | |||||
---------------------------*/ | |||||
else if ($dopost == "viewTemplet") { | else if ($dopost == "viewTemplet") { | ||||
header("location:tpl.php?path=/".$cfg_df_style); | header("location:tpl.php?path=/".$cfg_df_style); | ||||
exit(); | exit(); | ||||
} | } | ||||
//浏览单个页面的栏目 | |||||
/*------------------------ | |||||
浏览单个页面的栏目 | |||||
function ViewSgPage() | |||||
------------------------*/ | |||||
else if ($dopost == "viewSgPage") { | else if ($dopost == "viewSgPage") { | ||||
require_once(DEDEINC."/archive/listview.class.php"); | |||||
$lv = new ListView($cid); | $lv = new ListView($cid); | ||||
$pageurl = $lv->MakeHtml(); | $pageurl = $lv->MakeHtml(); | ||||
ShowMsg(Lang("catalog_upcache_wait"), $pageurl); | |||||
ShowMsg("更新缓冲,请稍后", $pageurl); | |||||
exit(); | exit(); | ||||
} | } | ||||
//修改栏目排列顺序 | |||||
/*------------------------ | |||||
修改栏目排列顺序 | |||||
function upRank() | |||||
------------------------*/ | |||||
else if ($dopost == "upRank") { | else if ($dopost == "upRank") { | ||||
//检查权限许可 | //检查权限许可 | ||||
UserLogin::CheckPurview('t_Edit,t_AccEdit'); | |||||
CheckPurview('t_Edit,t_AccEdit'); | |||||
//检查栏目操作许可 | //检查栏目操作许可 | ||||
UserLogin::CheckCatalog($cid, Lang("catalog_error_noedit_purview")); | |||||
CheckCatalog($cid, "您无权修改本栏目"); | |||||
$row = $dsql->GetOne("SELECT reid,sortrank FROM `#@__arctype` WHERE id='$cid'"); | $row = $dsql->GetOne("SELECT reid,sortrank FROM `#@__arctype` WHERE id='$cid'"); | ||||
$reid = $row['reid']; | $reid = $row['reid']; | ||||
$sortrank = $row['sortrank']; | $sortrank = $row['sortrank']; | ||||
$row = $dsql->GetOne("SELECT sortrank FROM `#@__arctype` WHERE sortrank<=$sortrank AND reid=$reid ORDER BY sortrank DESC"); | |||||
$row = $dsql->GetOne("SELECT sortrank FROM `#@__arctype` WHERE sortrank<=$sortrank AND reid=$reid ORDER BY sortrank DESC "); | |||||
if (is_array($row)) { | if (is_array($row)) { | ||||
$sortrank = $row['sortrank'] - 1; | $sortrank = $row['sortrank'] - 1; | ||||
$dsql->ExecuteNoneQuery("UPDATE `#@__arctype` SET sortrank='$sortrank' WHERE id='$cid'"); | $dsql->ExecuteNoneQuery("UPDATE `#@__arctype` SET sortrank='$sortrank' WHERE id='$cid'"); | ||||
} | } | ||||
UpDateCatCache(); | UpDateCatCache(); | ||||
ShowMsg(Lang('dopost_success_back'), "catalog_main.php"); | |||||
ShowMsg("操作成功,返回目录", "catalog_main.php"); | |||||
exit(); | exit(); | ||||
} else if ($dopost == "upRankAll") { | } else if ($dopost == "upRankAll") { | ||||
//检查权限许可 | //检查权限许可 | ||||
UserLogin::CheckPurview('t_Edit'); | |||||
CheckPurview('t_Edit'); | |||||
$row = $dsql->GetOne("SELECT id FROM `#@__arctype` ORDER BY id DESC"); | $row = $dsql->GetOne("SELECT id FROM `#@__arctype` ORDER BY id DESC"); | ||||
if (is_array($row)) { | if (is_array($row)) { | ||||
$maxID = $row['id']; | $maxID = $row['id']; | ||||
@@ -119,16 +130,19 @@ else if ($dopost == "upRank") { | |||||
} | } | ||||
} | } | ||||
UpDateCatCache(); | UpDateCatCache(); | ||||
ShowMsg(Lang('dopost_success_back'), "catalog_main.php"); | |||||
ShowMsg("操作成功,正在返回", "catalog_main.php"); | |||||
exit(); | exit(); | ||||
} | } | ||||
/*-------------------------- | |||||
//更新栏目缓存 | //更新栏目缓存 | ||||
function UpCatlogCache(); | |||||
---------------------------*/ | |||||
else if ($dopost == "upcatcache") { | else if ($dopost == "upcatcache") { | ||||
UpDateCatCache(); | UpDateCatCache(); | ||||
$sql = " TRUNCATE TABLE `#@__arctiny`"; | $sql = " TRUNCATE TABLE `#@__arctiny`"; | ||||
$dsql->ExecuteNoneQuery($sql); | $dsql->ExecuteNoneQuery($sql); | ||||
//导入普通模型微数据 | //导入普通模型微数据 | ||||
$sql = "INSERT INTO `#@__arctiny`(id, typeid, typeid2, arcrank, channel, senddate, sortrank, mid) SELECT id, typeid, typeid2, arcrank, channel, senddate, sortrank, mid FROM `#@__archives`"; | |||||
$sql = "INSERT INTO `#@__arctiny` (id, typeid, typeid2, arcrank, channel, senddate, sortrank, mid) SELECT id, typeid, typeid2, arcrank, channel, senddate, sortrank, mid FROM `#@__archives` "; | |||||
$dsql->ExecuteNoneQuery($sql); | $dsql->ExecuteNoneQuery($sql); | ||||
//导入单表模型微数据 | //导入单表模型微数据 | ||||
$dsql->SetQuery("SELECT id,addtable FROM `#@__channeltype` WHERE id < -1 "); | $dsql->SetQuery("SELECT id,addtable FROM `#@__channeltype` WHERE id < -1 "); | ||||
@@ -139,128 +153,151 @@ else if ($dopost == "upcatcache") { | |||||
if (empty($tb) || isset($doarray[$tb])) { | if (empty($tb) || isset($doarray[$tb])) { | ||||
continue; | continue; | ||||
} else { | } else { | ||||
$sql = "INSERT INTO `#@__arctiny`(id, typeid, typeid2, arcrank, channel, senddate, sortrank, mid) SELECT aid, typeid, 0, arcrank, channel, senddate, 0, mid FROM `$tb`"; | |||||
$sql = "INSERT INTO `#@__arctiny` (id, typeid, typeid2, arcrank, channel, senddate, sortrank, mid) SELECT aid, typeid, 0, arcrank, channel, senddate, 0, mid FROM `$tb` "; | |||||
$rs = $dsql->executenonequery($sql); | $rs = $dsql->executenonequery($sql); | ||||
$doarray[$tb] = 1; | $doarray[$tb] = 1; | ||||
} | } | ||||
} | } | ||||
ShowMsg(Lang('dopost_success_back'), "catalog_main.php"); | |||||
ShowMsg("操作成功,正在返回", "catalog_main.php"); | |||||
exit(); | exit(); | ||||
} | } | ||||
//获取js文件 | |||||
/*--------------------- | |||||
获取JS文件 | |||||
function GetJs | |||||
----------------------*/ | |||||
else if ($dopost == "GetJs") { | else if ($dopost == "GetJs") { | ||||
header("location:makehtml_js.php"); | header("location:makehtml_js.php"); | ||||
exit(); | exit(); | ||||
} | } | ||||
//获得子类菜单 | |||||
/*----------- | |||||
获得子类的内容 | |||||
function GetSunListsMenu(); | |||||
-----------*/ | |||||
else if ($dopost == "GetSunListsMenu") { | else if ($dopost == "GetSunListsMenu") { | ||||
$userChannel = $cUserLogin->getUserChannel(); | |||||
$userChannel = $cuserLogin->getUserChannel(); | |||||
require_once(DEDEINC."/typeunit/typeunit.class.menu.php"); | |||||
AjaxHead(); | AjaxHead(); | ||||
PutCookie('lastCidMenu', $cid, 3600 * 24, "/"); | PutCookie('lastCidMenu', $cid, 3600 * 24, "/"); | ||||
$tu = new TypeUnitMenu($userChannel); | |||||
$tu = new TypeUnit($userChannel); | |||||
$tu->LogicListAllSunType($cid, " "); | $tu->LogicListAllSunType($cid, " "); | ||||
} | } | ||||
//获得子类内容 | |||||
/*----------- | |||||
获得子类的内容 | |||||
function GetSunLists(); | |||||
-----------*/ | |||||
else if ($dopost == "GetSunLists") { | else if ($dopost == "GetSunLists") { | ||||
require_once(DEDEINC."/typelink/typeunit.class.admin.php"); | |||||
AjaxHead(); | AjaxHead(); | ||||
PutCookie('lastCid', $cid, 3600 * 24, "/"); | PutCookie('lastCid', $cid, 3600 * 24, "/"); | ||||
$tu = new TypeUnitAdmin(); | |||||
$tu = new TypeUnit(); | |||||
$tu->dsql = $dsql; | $tu->dsql = $dsql; | ||||
echo "<table width='100%' cellspacing='0' cellpadding='0'>\r\n"; | |||||
echo " <table width='100%' cellspacing='0' cellpadding='0'>\r\n"; | |||||
$tu->LogicListAllSunType($cid, " "); | $tu->LogicListAllSunType($cid, " "); | ||||
echo "</table>\r\n"; | |||||
echo " </table>\r\n"; | |||||
$tu->Close(); | $tu->Close(); | ||||
} | } | ||||
//合并栏目 | |||||
/*---------------- | |||||
合并栏目 | |||||
function unitCatalog() { } | |||||
-----------------*/ | |||||
else if ($dopost == 'unitCatalog') { | else if ($dopost == 'unitCatalog') { | ||||
UserLogin::CheckPurview('t_Move'); | |||||
require_once(DEDEINC.'/channel/channelunit.func.php'); | |||||
CheckPurview('t_Move'); | |||||
require_once(DEDEINC.'/libraries/oxwindow.class.php'); | |||||
require_once(DEDEINC.'/typelink/typelink.class.php'); | |||||
require_once(DEDEINC.'/channelunit.func.php'); | |||||
if (empty($nextjob)) { | if (empty($nextjob)) { | ||||
$typeid = isset($typeid) ? intval($typeid) : 0; | $typeid = isset($typeid) ? intval($typeid) : 0; | ||||
$row = $dsql->GetOne("SELECT COUNT(*) AS dd FROM `#@__arctype` WHERE reid='$typeid'"); | |||||
$row = $dsql->GetOne("SELECT COUNT(*) AS dd FROM `#@__arctype` WHERE reid='$typeid' "); | |||||
$tl = new TypeLink($typeid); | $tl = new TypeLink($typeid); | ||||
$typename = $tl->TypeInfos['typename']; | $typename = $tl->TypeInfos['typename']; | ||||
$reid = $tl->TypeInfos['reid']; | $reid = $tl->TypeInfos['reid']; | ||||
$channelid = $tl->TypeInfos['channeltype']; | $channelid = $tl->TypeInfos['channeltype']; | ||||
if (!empty($row['dd'])) { | if (!empty($row['dd'])) { | ||||
ShowMsg(Lang("catalog_merge_err_hasson", array('typename'=>$typename)), '-1'); | |||||
ShowMsg("栏目:$typename($typeid) 有子栏目,不能进行合并操作", '-1'); | |||||
exit(); | exit(); | ||||
} | } | ||||
$typeOptions = $tl->GetOptionArray(0, 0, $channelid); | $typeOptions = $tl->GetOptionArray(0, 0, $channelid); | ||||
$wintitle = Lang('catalog_merge'); | |||||
$wecome_info = "<a href='catalog_main.php'>".Lang('catalog_main')."</a> > ".Lang('catalog_merge'); | |||||
DedeWin::Instance()->Init('catalog_do.php', 'js/blank.js', 'POST') | |||||
->AddHidden('dopost', 'unitCatalog') | |||||
->AddHidden('typeid', $typeid) | |||||
->AddHidden('channelid', $channelid) | |||||
->AddHidden('nextjob', 'unitok') | |||||
->AddTitle(Lang('catalog_merge_tip1')) | |||||
->AddItem(Lang('catalog_merge_select_typename'), Lang('catalog_merge_tip2',array('typename'=>$typename))) | |||||
->AddItem(Lang('catalog_merge_to'), "<select name='unittype'>\r\n{$typeOptions}\r\n</select>") | |||||
->AddItem(Lang('care'), Lang('catalog_merge_tip3')) | |||||
->GetWindow('ok') | |||||
->Display(); | |||||
$wintitle = '合并栏目'; | |||||
$wecome_info = "<a href='catalog_main.php'>栏目管理</a> > 合并栏目"; | |||||
$win = new OxWindow(); | |||||
$win->Init('catalog_do.php', 'js/blank.js', 'POST'); | |||||
$win->AddHidden('dopost', 'unitCatalog'); | |||||
$win->AddHidden('typeid', $typeid); | |||||
$win->AddHidden('channelid', $channelid); | |||||
$win->AddHidden('nextjob', 'unitok'); | |||||
$win->AddTitle("合并目录时不会删除原来的栏目目录,合并后需手动更新目标栏目的文档HTML和列表HTML"); | |||||
$win->AddItem('您选择的栏目是:', "<span class='text-danger'>$typename($typeid)</span>"); | |||||
$win->AddItem('您希望合并到那个栏目', "<select name='unittype'>\r\n{$typeOptions}\r\n</select>"); | |||||
$win->AddItem('注意事项:', '栏目不能有下级子栏目,只允许子级到更高级或同级或不同父级的情况'); | |||||
$winform = $win->GetWindow('ok'); | |||||
$win->Display(); | |||||
exit(); | exit(); | ||||
} else { | } else { | ||||
if ($typeid == $unittype) { | if ($typeid == $unittype) { | ||||
ShowMsg(Lang('catalog_merge_err_same'), '-1'); | |||||
ShowMsg("同一栏目无法合并,请后退重试", '-1'); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (IsParent($unittype, $typeid)) { | if (IsParent($unittype, $typeid)) { | ||||
ShowMsg(Lang('catalog_merge_err_parent2son'), 'catalog_main.php'); | |||||
ShowMsg('不能从父类合并到子类', 'catalog_main.php'); | |||||
exit(); | exit(); | ||||
} | } | ||||
$row = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid'"); | |||||
$row = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid' "); | |||||
$addtable = (empty($row['addtable']) ? '#@__addonarticle' : $row['addtable']); | $addtable = (empty($row['addtable']) ? '#@__addonarticle' : $row['addtable']); | ||||
$dsql->ExecuteNoneQuery("UPDATE `#@__arctiny` SET typeid='$unittype' WHERE typeid='$typeid'"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `#@__feedback` SET typeid='$unittype' WHERE typeid='$typeid'"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `#@__archives` SET typeid='$unittype' WHERE typeid='$typeid'"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `#@__archives` SET typeid2='$unittype' WHERE typeid2='$typeid'"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `#@__addonspec` SET typeid='$unittype' WHERE typeid='$typeid'"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `$addtable` SET typeid='$unittype' WHERE typeid='$typeid'"); | |||||
$dsql->ExecuteNoneQuery("DELETE FROM `#@__arctype` WHERE id='$typeid'"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `#@__arctiny` SET typeid='$unittype' WHERE typeid='$typeid' "); | |||||
$dsql->ExecuteNoneQuery("UPDATE `#@__feedback` SET typeid='$unittype' WHERE typeid='$typeid' "); | |||||
$dsql->ExecuteNoneQuery("UPDATE `#@__archives` SET typeid='$unittype' WHERE typeid='$typeid' "); | |||||
$dsql->ExecuteNoneQuery("UPDATE `#@__archives` SET typeid2='$unittype' WHERE typeid2='$typeid' "); | |||||
$dsql->ExecuteNoneQuery("UPDATE `#@__addonspec` SET typeid='$unittype' WHERE typeid='$typeid' "); | |||||
$dsql->ExecuteNoneQuery("UPDATE `$addtable` SET typeid='$unittype' WHERE typeid='$typeid' "); | |||||
$dsql->ExecuteNoneQuery("DELETE FROM `#@__arctype` WHERE id='$typeid' "); | |||||
UpDateCatCache(); | UpDateCatCache(); | ||||
ShowMsg(Lang('catalog_merge_success'), 'catalog_main.php'); | |||||
ShowMsg('成功合并指定栏目', 'catalog_main.php'); | |||||
exit(); | exit(); | ||||
} | } | ||||
} | } | ||||
//移动栏目 | |||||
/*---------------- | |||||
移动栏目 | |||||
function moveCatalog() { } | |||||
-----------------*/ | |||||
else if ($dopost == 'moveCatalog') { | else if ($dopost == 'moveCatalog') { | ||||
UserLogin::CheckPurview('t_Move'); | |||||
require_once(DEDEINC.'/channel/channelunit.func.php'); | |||||
CheckPurview('t_Move'); | |||||
require_once(DEDEINC.'/libraries/oxwindow.class.php'); | |||||
require_once(DEDEINC.'/typelink/typelink.class.php'); | |||||
require_once(DEDEINC.'/channelunit.func.php'); | |||||
if (empty($nextjob)) { | if (empty($nextjob)) { | ||||
$tl = new TypeLink($typeid); | $tl = new TypeLink($typeid); | ||||
$typename = $tl->TypeInfos['typename']; | $typename = $tl->TypeInfos['typename']; | ||||
$reid = $tl->TypeInfos['reid']; | $reid = $tl->TypeInfos['reid']; | ||||
$channelid = $tl->TypeInfos['channeltype']; | $channelid = $tl->TypeInfos['channeltype']; | ||||
$typeOptions = $tl->GetOptionArray(0, 0, $channelid); | $typeOptions = $tl->GetOptionArray(0, 0, $channelid); | ||||
$wintitle = Lang('catalog_move'); | |||||
$wecome_info = "<a href='catalog_main.php'>".Lang('catalog_main')."</a> > ".Lang('catalog_move'); | |||||
DedeWin::Instance()->Init('catalog_do.php', 'js/blank.js', 'POST') | |||||
->AddHidden('dopost', 'moveCatalog') | |||||
->AddHidden('typeid', $typeid) | |||||
->AddHidden('channelid', $channelid) | |||||
->AddHidden('nextjob', 'unitok') | |||||
->AddTitle(Lang("catalog_move_tip")) | |||||
->AddItem(Lang('catalog').':', "$typename($typeid)") | |||||
->AddItem(Lang('select_catalog'), "<select name='movetype'>\r\n<option value='0'>".Lang('catalog_top')."</option>\r\n$typeOptions\r\n</select>") | |||||
->AddItem(Lang('care').':', Lang('catalog_move_tip2')) | |||||
->GetWindow('ok') | |||||
->Display(); | |||||
$wintitle = "移动栏目"; | |||||
$wecome_info = "<a href='catalog_main.php'>栏目管理</a> > 移动栏目"; | |||||
$win = new OxWindow(); | |||||
$win->Init('catalog_do.php', 'js/blank.js', 'POST'); | |||||
$win->AddHidden('dopost', 'moveCatalog'); | |||||
$win->AddHidden('typeid', $typeid); | |||||
$win->AddHidden('channelid', $channelid); | |||||
$win->AddHidden('nextjob', 'unitok'); | |||||
$win->AddTitle("移动目录时不会删除原来已创建的列表,移动后需重新对栏目创建HTML"); | |||||
$win->AddItem('您选择的栏目是:', "$typename($typeid)"); | |||||
$win->AddItem('您希望移动到那个栏目', "<select name='movetype'>\r\n<option value='0'>移动为顶级栏目</option>\r\n$typeOptions\r\n</select>"); | |||||
$win->AddItem('注意事项:', '不允许从父级移动到子级目录,只允许子级到更高级或同级或不同父级的情况'); | |||||
$winform = $win->GetWindow('ok'); | |||||
$win->Display(); | |||||
exit(); | exit(); | ||||
} else { | } else { | ||||
if ($typeid == $movetype) { | if ($typeid == $movetype) { | ||||
ShowMsg(Lang('catalog_move_err_same'), 'catalog_main.php'); | |||||
ShowMsg('移对对象和目标位置相同', 'catalog_main.php'); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (IsParent($movetype, $typeid)) { | if (IsParent($movetype, $typeid)) { | ||||
ShowMsg(Lang('catalog_move_err_parent2son'), 'catalog_main.php'); | |||||
ShowMsg('不能从父类移动到子类', 'catalog_main.php'); | |||||
exit(); | exit(); | ||||
} | } | ||||
$topid = GetTopid($movetype); | $topid = GetTopid($movetype); | ||||
$dsql->ExecuteNoneQuery("UPDATE `#@__arctype` SET reid='$movetype',topid='$topid' WHERE id='$typeid'"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `#@__arctype` SET reid='$movetype',topid='$topid' WHERE id='$typeid' "); | |||||
UpDateCatCache(); | UpDateCatCache(); | ||||
ShowMsg(Lang('catalog_move_success'), 'catalog_main.php'); | |||||
ShowMsg('成功移动目录', 'catalog_main.php'); | |||||
exit(); | exit(); | ||||
} | } | ||||
} | } |
@@ -8,14 +8,17 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
require_once(DEDEINC."/typelink/typelink.class.php"); | |||||
if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
$id = isset($id) ? intval($id) : 0; | $id = isset($id) ? intval($id) : 0; | ||||
//检查权限许可 | //检查权限许可 | ||||
UserLogin::CheckPurview('t_Edit,t_AccEdit'); | |||||
CheckPurview('t_Edit,t_AccEdit'); | |||||
//检查栏目操作许可 | //检查栏目操作许可 | ||||
UserLogin::CheckCatalog($id, Lang('catalog_err_edit_noperm')); | |||||
CheckCatalog($id, '您无权修改本栏目'); | |||||
/*----------------------- | |||||
function action_save() | |||||
----------------------*/ | |||||
if ($dopost == "save") { | if ($dopost == "save") { | ||||
$description = Html2Text($description, 1); | $description = Html2Text($description, 1); | ||||
$keywords = Html2Text($keywords, 1); | $keywords = Html2Text($keywords, 1); | ||||
@@ -26,14 +29,14 @@ if ($dopost == "save") { | |||||
$uptopsql = " ,siteurl='$siteurl',sitepath='$sitepath',ishidden='$ishidden' "; | $uptopsql = " ,siteurl='$siteurl',sitepath='$sitepath',ishidden='$ishidden' "; | ||||
} | } | ||||
if ($ispart != 0) $cross = 0; | if ($ispart != 0) $cross = 0; | ||||
$upquery = "UPDATE `#@__arctype` SET issend='$issend',sortrank='$sortrank',typename='$typename',cnoverview='$cnoverview',enname='$enname',enoverview='$enoverview',bigpic='$bigpic',litimg='$litimg',typedir='$typedir',isdefault='$isdefault',defaultname='$defaultname',issend='$issend',ishidden='$ishidden',channeltype='$channeltype',tempindex='$tempindex',templist='$templist',temparticle='$temparticle',namerule='$namerule',namerule2='$namerule2',ispart='$ispart',corank='$corank',description='$description',keywords='$keywords',seotitle='$seotitle',moresite='$moresite',`iscross`='$cross',`content`='$content',`crossid`='$crossid',`smalltypes`='$smalltypes' $uptopsql WHERE id='$id'"; | |||||
$upquery = "UPDATE `#@__arctype` SET issend='$issend',sortrank='$sortrank',typename='$typename',cnoverview='$cnoverview',enname='$enname',enoverview='$enoverview',bigpic='$bigpic',litimg='$litimg',typedir='$typedir',isdefault='$isdefault',defaultname='$defaultname',issend='$issend',ishidden='$ishidden',channeltype='$channeltype',tempindex='$tempindex',templist='$templist',temparticle='$temparticle',namerule='$namerule',namerule2='$namerule2',ispart='$ispart',corank='$corank',description='$description',keywords='$keywords',seotitle='$seotitle',moresite='$moresite',`cross`='$cross',`content`='$content',`crossid`='$crossid',`smalltypes`='$smalltypes'$uptopsql WHERE id='$id' "; | |||||
if (!$dsql->ExecuteNoneQuery($upquery)) { | if (!$dsql->ExecuteNoneQuery($upquery)) { | ||||
ShowMsg(Lang("catalog_err_update"), "-1"); | |||||
ShowMsg("保存当前栏目修改时失败,请检查您的输入资料是否存在问题", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
//如果选择子栏目可投稿,更新顶级栏目为可投稿 | //如果选择子栏目可投稿,更新顶级栏目为可投稿 | ||||
if ($topid > 0 && $issend == 1) { | if ($topid > 0 && $issend == 1) { | ||||
$dsql->ExecuteNoneQuery("UPDATE `#@__arctype` SET issend='$issend' WHERE id='$topid';"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `#@__arctype` SET issend='$issend' WHERE id='$topid'; "); | |||||
} | } | ||||
$slinks = " id IN (".GetSonIds($id).")"; | $slinks = " id IN (".GetSonIds($id).")"; | ||||
//修改顶级栏目时强制修改下级的多站点支持属性 | //修改顶级栏目时强制修改下级的多站点支持属性 | ||||
@@ -43,14 +46,14 @@ if ($dopost == "save") { | |||||
} | } | ||||
//修改子栏目属性 | //修改子栏目属性 | ||||
if (!empty($upnext)) { | if (!empty($upnext)) { | ||||
$upquery = "UPDATE `#@__arctype` SET issend='$issend',defaultname='$defaultname',channeltype='$channeltype',tempindex='$tempindex',templist='$templist',temparticle='$temparticle',namerule='$namerule',namerule2='$namerule2',ishidden='$ishidden' WHERE 1=1 AND $slinks"; | |||||
$upquery = "UPDATE `#@__arctype` SETissend='$issend',defaultname='$defaultname',channeltype='$channeltype',tempindex='$tempindex',templist='$templist',temparticle='$temparticle',namerule='$namerule',namerule2='$namerule2',ishidden='$ishidden' WHERE 1=1 AND $slinks"; | |||||
if (!$dsql->ExecuteNoneQuery($upquery)) { | if (!$dsql->ExecuteNoneQuery($upquery)) { | ||||
ShowMsg(Lang("catalog_err_update_son"), "-1"); | |||||
ShowMsg("修改当前栏目成功,但修改下级栏目属性时失败", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
} | } | ||||
UpDateCatCache(); | UpDateCatCache(); | ||||
ShowMsg(Lang("catalog_success_update"), "catalog_main.php"); | |||||
ShowMsg("成功修改一个分类", "catalog_main.php"); | |||||
exit(); | exit(); | ||||
} //End Save Action | } //End Save Action | ||||
else if ($dopost == "savetime") { | else if ($dopost == "savetime") { | ||||
@@ -67,15 +70,15 @@ else if ($dopost == "savetime") { | |||||
} | } | ||||
//如果选择子栏目可投稿,更新顶级栏目为可投稿 | //如果选择子栏目可投稿,更新顶级栏目为可投稿 | ||||
if ($topid > 0 && $issend == 1) { | if ($topid > 0 && $issend == 1) { | ||||
$dsql->ExecuteNoneQuery("UPDATE `#@__arctype` SET issend='$issend' WHERE id='$topid';"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `#@__arctype` SET issend='$issend' WHERE id='$topid'; "); | |||||
} | } | ||||
$upquery = "UPDATE `#@__arctype` SETissend='$issend',sortrank='$sortrank',typedir='$typedir',typename='$typename',isdefault='$isdefault',defaultname='$defaultname',ispart='$ispart',corank='$corank' $uptopsql WHERE id='$id'"; | |||||
$upquery = "UPDATE `#@__arctype` SET issend='$issend',sortrank='$sortrank',typedir='$typedir',typename='$typename',isdefault='$isdefault',defaultname='$defaultname',ispart='$ispart',corank='$corank' $uptopsql WHERE id='$id' "; | |||||
if (!$dsql->ExecuteNoneQuery($upquery)) { | if (!$dsql->ExecuteNoneQuery($upquery)) { | ||||
ShowMsg(Lang("catalog_err_update"), "-1"); | |||||
ShowMsg("保存当前栏目修改时失败,请检查您的输入资料是否存在问题", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
UpDateCatCache(); | UpDateCatCache(); | ||||
ShowMsg(Lang("catalog_success_update"), "catalog_main.php"); | |||||
ShowMsg("成功修改一个分类", "catalog_main.php"); | |||||
exit(); | exit(); | ||||
} | } | ||||
//读取栏目信息 | //读取栏目信息 | ||||
@@ -112,33 +115,33 @@ if ($dopost == 'time') { | |||||
<input type="hidden" name="moresite" value="<?php echo $myrow['moresite'];?>"> | <input type="hidden" name="moresite" value="<?php echo $myrow['moresite'];?>"> | ||||
<table width="100%" cellpadding="0" cellspacing="0"> | <table width="100%" cellpadding="0" cellspacing="0"> | ||||
<tr> | <tr> | ||||
<td width="160" align="center" class="bline"><?php echo Lang('support_submission');?>:</td> | |||||
<td width="160" class="bline" align="center">是否支持投稿:</td> | |||||
<td class="bline"> | <td class="bline"> | ||||
<label><input type="radio" name="issend" value="1" <?php if ($myrow['issend'] == "1") echo "checked='1'";?>> <?php echo Lang('support');?></label> | |||||
<label><input type="radio" name="issend" value="0" <?php if ($myrow['issend'] == "0") echo "checked='1'";?>> <?php echo Lang('unsupport');?></label> | |||||
<label><input type="radio" name="issend" value="1" <?php if ($myrow['issend'] == "1") echo "checked='1'";?>> 支持</label> | |||||
<label><input type="radio" name="issend" value="0" <?php if ($myrow['issend'] == "0") echo "checked='1'";?>> 不支持</label> | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td align="center" class="bline"><?php echo Lang('mychannel');?>:</td> | |||||
<td class="bline" align="center">内容模型:</td> | |||||
<td class="bline"> | <td class="bline"> | ||||
<?php | <?php | ||||
foreach ($channelArray as $k => $arr) { | foreach ($channelArray as $k => $arr) { | ||||
if ($k == $channelid) echo "{$arr['typename']} | {$arr['nid']}"; | if ($k == $channelid) echo "{$arr['typename']} | {$arr['nid']}"; | ||||
} | } | ||||
?> | ?> | ||||
<a href='catalog_edit.php?id=<?php echo $id;?>' class='btn btn-success btn-sm'><?php echo Lang('more');?></a> | |||||
<a href='catalog_edit.php?id=<?php echo $id;?>' class='btn btn-success btn-sm'>更多模型</a> | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td align="center" class="bline"><?php echo Lang('catalog_typename');?>:</td> | |||||
<td class="bline" align="center">栏目名称:</td> | |||||
<td class="bline"><input type="text" name="typename" value="<?php echo $myrow['typename'] ?>" style="width:260px"></td> | <td class="bline"><input type="text" name="typename" value="<?php echo $myrow['typename'] ?>" style="width:260px"></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td align="center" class="bline"> <?php echo Lang('sortrank');?>:</td> | |||||
<td class="bline"> <input type="text" name="sortrank" value="<?php echo $myrow['sortrank'] ?>" style="width:100px"><?php echo Lang('sortrank_msg');?></td> | |||||
<td class="bline" align="center"> 排列顺序:</td> | |||||
<td class="bline"> <input type="text" name="sortrank" value="<?php echo $myrow['sortrank'] ?>" style="width:100px">(由低 > 高)</td> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td align="center" class="bline"><?php echo Lang('corank');?>:</td> | |||||
<td class="bline" align="center">浏览权限:</td> | |||||
<td class="bline"> | <td class="bline"> | ||||
<select name="corank" id="corank" style="width:100px"> | <select name="corank" id="corank" style="width:100px"> | ||||
<?php | <?php | ||||
@@ -151,37 +154,37 @@ if ($dopost == 'time') { | |||||
echo "<option value='".$row->rank."'>".$row->membername."</option>\r\n"; | echo "<option value='".$row->rank."'>".$row->membername."</option>\r\n"; | ||||
} | } | ||||
?> | ?> | ||||
</select><?php echo Lang('corank_msg');?> | |||||
</select>(仅限制栏目里的文档浏览权限) | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td align="center" class="bline"><?php echo Lang('catalog_typedir');?>:</td> | |||||
<td class="bline" align="center">文件保存目录:</td> | |||||
<td class="bline"><input type="text" name="typedir" value="<?php echo $myrow['typedir'] ?>" style="width:260px"></td> | <td class="bline"><input type="text" name="typedir" value="<?php echo $myrow['typedir'] ?>" style="width:260px"></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td align="center" class="bline"><?php echo Lang('catalog_list_option');?>:</td> | |||||
<td align="center" class="bline">栏目列表选项:</td> | |||||
<td class="bline"> | <td class="bline"> | ||||
<label><input type="radio" name="isdefault" value="1" <?php if ($myrow['isdefault'] == 1) echo "checked='1'";?>> <?php echo Lang('catalog_list_option_1');?></label> | |||||
<label><input type="radio" name="isdefault" value="0" <?php if ($myrow['isdefault'] == 0) echo "checked='1'";?>> <?php echo Lang('catalog_list_option_0');?></label> | |||||
<label><input type="radio" name="isdefault" value="-1" <?php if ($myrow['isdefault'] == -1) echo "checked='1'";?>> <?php echo Lang('catalog_list_option_-1');?></label> | |||||
<label><input type="radio" name="isdefault" value="1" <?php if ($myrow['isdefault'] == 1) echo "checked='1'";?>> 链接到默认页</label> | |||||
<label><input type="radio" name="isdefault" value="0" <?php if ($myrow['isdefault'] == 0) echo "checked='1'";?>> 链接到列表第一页</label> | |||||
<label><input type="radio" name="isdefault" value="-1" <?php if ($myrow['isdefault'] == -1) echo "checked='1'";?>> 使用动态页</label> | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td align="center" class="bline"><?php echo Lang('catalog_default_name');?>:</td> | |||||
<td class="bline" align="center">默认页的名称:</td> | |||||
<td class="bline"><input type="text" name="defaultname" value="<?php echo $myrow['defaultname'] ?>" style="width:260px"></td> | <td class="bline"><input type="text" name="defaultname" value="<?php echo $myrow['defaultname'] ?>" style="width:260px"></td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td align="center" class="bline"><?php echo Lang('catalog_ispart');?>:</td> | |||||
<td class="bline" align="center">栏目属性:</td> | |||||
<td class="bline"> | <td class="bline"> | ||||
<label><input name="ispart" type="radio" value="0" <?php if ($myrow['ispart'] == 0) echo "checked='1'";?>> <?php echo Lang('catalog_ispart_0');?></label><br> | |||||
<label><input name="ispart" type="radio" value="1" <?php if ($myrow['ispart'] == 1) echo "checked='1'";?>> <?php echo Lang('catalog_ispart_1');?></label><br> | |||||
<label><input name="ispart" type="radio" value="2" <?php if ($myrow['ispart'] == 2) echo "checked='1'";?>> <?php echo Lang('catalog_ispart_2');?></label> | |||||
<label><input name="ispart" type="radio" value="0" <?php if ($myrow['ispart'] == 0) echo "checked='1'";?>> 最终列表栏目(允许在本栏目发布文档,并生成文档列表)</label><br> | |||||
<label><input name="ispart" type="radio" value="1" <?php if ($myrow['ispart'] == 1) echo "checked='1'";?>> 频道封面(栏目本身不允许发布文档)</label><br> | |||||
<label><input name="ispart" type="radio" value="2" <?php if ($myrow['ispart'] == 2) echo "checked='1'";?>> 外部连接(在"文件保存目录"处填写网址)</label> | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td bgcolor="#f8fcf2" colspan="2" align="center" class="py-2"> | |||||
<button onclick='getSelCat("<?php echo $targetid;?>");' class='btn btn-success btn-sm'><?php echo Lang('save');?></button> | |||||
<button type='button' onclick='CloseMsg()' class='btn btn-success btn-sm'><?php echo Lang('close');?></button> | |||||
<td bgcolor="#fbfce2" colspan="2" align="center" class="py-2"> | |||||
<button onclick='getSelCat("<?php echo $targetid;?>");' class='btn btn-success btn-sm'>保存</button> | |||||
<button type='button' onclick='CloseMsg()' class='btn btn-success btn-sm'>关闭</button> | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
</table> | </table> | ||||
@@ -9,6 +9,7 @@ | |||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
$userChannel = $cUserLogin->getUserChannel(); | |||||
require_once(DEDEINC."/typelink/typeunit.class.admin.php"); | |||||
$userChannel = $cuserLogin->getUserChannel(); | |||||
include DedeInclude('templets/catalog_main.htm'); | include DedeInclude('templets/catalog_main.htm'); | ||||
?> | ?> |
@@ -8,10 +8,9 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
define('DEDEADMIN', str_replace("\\", '/', dirname(__FILE__))); | define('DEDEADMIN', str_replace("\\", '/', dirname(__FILE__))); | ||||
define('LANGSECTION', 'admin'); | |||||
require_once(DEDEADMIN.'/../system/common.inc.php'); | require_once(DEDEADMIN.'/../system/common.inc.php'); | ||||
require_once(DEDEINC.'/userlogin.class.php'); | |||||
header('Cache-Control:private'); | header('Cache-Control:private'); | ||||
$dsql->safeCheck = FALSE; | $dsql->safeCheck = FALSE; | ||||
$dsql->SetLongLink(); | $dsql->SetLongLink(); | ||||
@@ -48,8 +47,8 @@ $dedeNowurl = GetCurUrl(); | |||||
$dedeNowurls = explode('?', $dedeNowurl); | $dedeNowurls = explode('?', $dedeNowurl); | ||||
$s_scriptName = $dedeNowurls[0]; | $s_scriptName = $dedeNowurls[0]; | ||||
//检验用户登录状态 | //检验用户登录状态 | ||||
$cUserLogin = new UserLogin(); | |||||
if ($cUserLogin->getUserID() == -1) { | |||||
$cuserLogin = new userLogin(); | |||||
if ($cuserLogin->getUserID() == -1) { | |||||
if (preg_match("#PHP (.*) Development Server#", $_SERVER['SERVER_SOFTWARE'])) { | if (preg_match("#PHP (.*) Development Server#", $_SERVER['SERVER_SOFTWARE'])) { | ||||
$dirname = dirname($_SERVER['SCRIPT_NAME']); | $dirname = dirname($_SERVER['SCRIPT_NAME']); | ||||
header("location:{$dirname}/login.php?gotopage=".urlencode($dedeNowurl)); | header("location:{$dirname}/login.php?gotopage=".urlencode($dedeNowurl)); | ||||
@@ -78,7 +77,7 @@ if ($cfg_dede_log == 'Y') { | |||||
$s_scriptNames = $s_scriptNames[count($s_scriptNames) - 1]; | $s_scriptNames = $s_scriptNames[count($s_scriptNames) - 1]; | ||||
$s_userip = GetIP(); | $s_userip = GetIP(); | ||||
if ($s_method == 'POST' || (!preg_match("#".$s_nologfile."#i", $s_scriptNames) && $s_query != '') || preg_match("#".$s_needlogfile."#i", $s_scriptNames)) { | if ($s_method == 'POST' || (!preg_match("#".$s_nologfile."#i", $s_scriptNames) && $s_query != '') || preg_match("#".$s_needlogfile."#i", $s_scriptNames)) { | ||||
$inquery = "INSERT INTO `#@__log`(adminid,filename,method,query,cip,dtime) VALUES ('".$cUserLogin->getUserID()."','{$s_scriptNames}','{$s_method}','".addslashes($s_query)."','{$s_userip}','".time()."');"; | |||||
$inquery = "INSERT INTO `#@__log` (adminid,filename,method,query,cip,dtime) VALUES ('".$cuserLogin->getUserID()."','{$s_scriptNames}','{$s_method}','".addslashes($s_query)."','{$s_userip}','".time()."');"; | |||||
$dsql->ExecuteNoneQuery($inquery); | $dsql->ExecuteNoneQuery($inquery); | ||||
} | } | ||||
} | } | ||||
@@ -88,7 +87,7 @@ if (file_exists(DEDEDATA."/downmix.data.php")) { | |||||
//管理缓存管理员频道缓存 | //管理缓存管理员频道缓存 | ||||
$cache1 = DEDEDATA.'/cache/inc_catalog_base.inc'; | $cache1 = DEDEDATA.'/cache/inc_catalog_base.inc'; | ||||
if (!file_exists($cache1)) UpDateCatCache(); | if (!file_exists($cache1)) UpDateCatCache(); | ||||
$cacheFile = DEDEDATA.'/cache/admincat_'.$cUserLogin->userID.'.inc'; | |||||
$cacheFile = DEDEDATA.'/cache/admincat_'.$cuserLogin->userID.'.inc'; | |||||
if (file_exists($cacheFile)) require_once($cacheFile); | if (file_exists($cacheFile)) require_once($cacheFile); | ||||
/** | /** | ||||
* 更新栏目缓存 | * 更新栏目缓存 | ||||
@@ -98,7 +97,7 @@ if (file_exists($cacheFile)) require_once($cacheFile); | |||||
*/ | */ | ||||
function UpDateCatCache() | function UpDateCatCache() | ||||
{ | { | ||||
global $dsql, $cache1, $cUserLogin; | |||||
global $dsql, $cache1, $cuserLogin; | |||||
$cache2 = DEDEDATA.'/cache/channelsonlist.inc'; | $cache2 = DEDEDATA.'/cache/channelsonlist.inc'; | ||||
$cache3 = DEDEDATA.'/cache/channeltoplist.inc'; | $cache3 = DEDEDATA.'/cache/channeltoplist.inc'; | ||||
$dsql->SetQuery("SELECT id,reid,channeltype,issend,typename FROM `#@__arctype`"); | $dsql->SetQuery("SELECT id,reid,channeltype,issend,typename FROM `#@__arctype`"); | ||||
@@ -114,7 +113,7 @@ function UpDateCatCache() | |||||
} | } | ||||
fwrite($fp1, "{$phph}>"); | fwrite($fp1, "{$phph}>"); | ||||
fclose($fp1); | fclose($fp1); | ||||
$cUserLogin->ReWriteAdminChannel(); | |||||
$cuserLogin->ReWriteAdminChannel(); | |||||
@unlink($cache2); | @unlink($cache2); | ||||
@unlink($cache3); | @unlink($cache3); | ||||
} | } | ||||
@@ -156,9 +155,9 @@ if (!function_exists('GetMemberName')) { | |||||
{ | { | ||||
global $dsql; | global $dsql; | ||||
if (empty($mid)) { | if (empty($mid)) { | ||||
return Lang("administrator"); | |||||
return "管理员"; | |||||
} | } | ||||
$rs = $dsql->GetOne("SELECT * FROM `#@__member` WHERE mid='{$mid}'"); | |||||
$rs = $dsql->GetOne("SELECT * FROM `#@__member` WHERE mid='{$mid}' "); | |||||
return $rs['uname']; | return $rs['uname']; | ||||
} | } | ||||
} | } |
@@ -8,9 +8,8 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('sys_Att'); | |||||
CheckPurview('sys_Att'); | |||||
if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
//保存修改 | //保存修改 | ||||
if ($dopost == "save") { | if ($dopost == "save") { | ||||
@@ -20,10 +19,10 @@ if ($dopost == "save") { | |||||
$att = ${'att_'.$startID}; | $att = ${'att_'.$startID}; | ||||
$attname = ${'attname_'.$startID}; | $attname = ${'attname_'.$startID}; | ||||
$sortid = ${'sortid_'.$startID}; | $sortid = ${'sortid_'.$startID}; | ||||
$query = "UPDATE `#@__arcatt` SET `attname`='$attname',`sortid`='$sortid' WHERE att='$att'"; | |||||
$query = "UPDATE `#@__arcatt` SET `attname`='$attname',`sortid`='$sortid' WHERE att='$att' "; | |||||
$dsql->ExecuteNoneQuery($query); | $dsql->ExecuteNoneQuery($query); | ||||
} | } | ||||
echo "<script> alert('".Lang('content_att_success')."'); </script>"; | |||||
echo "<script> alert('成功更新自定文档义属性表'); </script>"; | |||||
} | } | ||||
include DedeInclude('templets/content_att.htm'); | include DedeInclude('templets/content_att.htm'); | ||||
?> | ?> |
@@ -9,5 +9,6 @@ | |||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
require_once(dirname(__FILE__).'/config.php'); | require_once(dirname(__FILE__).'/config.php'); | ||||
require_once(DEDEINC.'/typelink/typelink.class.php'); | |||||
include DedeInclude('templets/content_batch_up.htm'); | include DedeInclude('templets/content_batch_up.htm'); | ||||
?> | ?> |
@@ -8,11 +8,12 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('sys_ArcBatch'); | |||||
CheckPurview('sys_ArcBatch'); | |||||
require_once(DEDEINC."/typelink/typelink.class.php"); | |||||
require_once(DEDEADMIN."/inc/inc_batchup.php"); | require_once(DEDEADMIN."/inc/inc_batchup.php"); | ||||
@set_time_limit(0); | @set_time_limit(0); | ||||
//获取id条件 | |||||
if (empty($startid)) $startid = 0; | if (empty($startid)) $startid = 0; | ||||
if (empty($endid)) $endid = 0; | if (empty($endid)) $endid = 0; | ||||
if (empty($seltime)) $seltime = 0; | if (empty($seltime)) $seltime = 0; | ||||
@@ -26,6 +27,7 @@ if ($action == "makehtml") { | |||||
header("Location: $jumpurl"); | header("Location: $jumpurl"); | ||||
exit(); | exit(); | ||||
} | } | ||||
$gwhere = " WHERE 1 "; | $gwhere = " WHERE 1 "; | ||||
if ($startid > 0) $gwhere .= " AND id>= $startid "; | if ($startid > 0) $gwhere .= " AND id>= $startid "; | ||||
if ($endid > $startid) $gwhere .= " AND id<= $endid "; | if ($endid > $startid) $gwhere .= " AND id<= $endid "; | ||||
@@ -40,7 +42,7 @@ if ($seltime == 1) { | |||||
$gwhere .= " AND (senddate >= $t1 AND senddate <= $t2) "; | $gwhere .= " AND (senddate >= $t1 AND senddate <= $t2) "; | ||||
} | } | ||||
if (!empty($userid)) { | if (!empty($userid)) { | ||||
$row = $dsql->GetOne("SELECT `mid` FROM `#@__member` WHERE `userid` LIKE '$userid'"); | |||||
$row = $dsql->GetOne("SELECT `mid` FROM #@__member WHERE `userid` LIKE '$userid'"); | |||||
if (is_array($row)) { | if (is_array($row)) { | ||||
$gwhere .= " AND mid = {$row['mid']} "; | $gwhere .= " AND mid = {$row['mid']} "; | ||||
} | } | ||||
@@ -50,7 +52,7 @@ if (!empty($heightdone)) $action = $heightdone; | |||||
//指量审核 | //指量审核 | ||||
if ($action == 'check') { | if ($action == 'check') { | ||||
if (empty($startid) || empty($endid) || $endid < $startid) { | if (empty($startid) || empty($endid) || $endid < $startid) { | ||||
ShowMsg(Lang('content_error_id_check'), 'javascript:;'); | |||||
ShowMsg('该操作必须指定起始id', 'javascript:;'); | |||||
exit(); | exit(); | ||||
} | } | ||||
$jumpurl = "makehtml_archives_action.php?endid=$endid&startid=$startid"; | $jumpurl = "makehtml_archives_action.php?endid=$endid&startid=$startid"; | ||||
@@ -64,13 +66,13 @@ if ($action == 'check') { | |||||
$dsql->ExecuteNoneQuery("UPDATE `#@__archives` SET arcrank=0 WHERE id='{$row->id}'"); | $dsql->ExecuteNoneQuery("UPDATE `#@__archives` SET arcrank=0 WHERE id='{$row->id}'"); | ||||
} | } | ||||
} | } | ||||
ShowMsg(Lang("content_batch_check_success"), $jumpurl); | |||||
ShowMsg("完成数据库的审核处理,准备更新HTML", $jumpurl); | |||||
exit(); | exit(); | ||||
} | } | ||||
//批量删除 | //批量删除 | ||||
else if ($action == 'del') { | else if ($action == 'del') { | ||||
if (empty($startid) || empty($endid) || $endid < $startid) { | if (empty($startid) || empty($endid) || $endid < $startid) { | ||||
ShowMsg(Lang('content_error_id_check'), 'javascript:;'); | |||||
ShowMsg('该操作必须指定起始id', 'javascript:;'); | |||||
exit(); | exit(); | ||||
} | } | ||||
$dsql->SetQuery("SELECT id FROM `#@__archives` $gwhere"); | $dsql->SetQuery("SELECT id FROM `#@__archives` $gwhere"); | ||||
@@ -79,60 +81,62 @@ else if ($action == 'del') { | |||||
while ($row = $dsql->GetObject('x')) { | while ($row = $dsql->GetObject('x')) { | ||||
if (DelArc($row->id)) $tdd++; | if (DelArc($row->id)) $tdd++; | ||||
} | } | ||||
ShowMsg(Lang('content_batch_delete_success',array('tdd'=>$tdd)), "javascript:;"); | |||||
ShowMsg("成功删除 $tdd 条记录", "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
//删除空标题文档 | //删除空标题文档 | ||||
else if ($action == 'delnulltitle') { | else if ($action == 'delnulltitle') { | ||||
$dsql->SetQuery("SELECT id FROM `#@__archives` WHERE trim(title)=''"); | |||||
$dsql->SetQuery("SELECT id FROM `#@__archives` WHERE trim(title)='' "); | |||||
$dsql->Execute('x'); | $dsql->Execute('x'); | ||||
$tdd = 0; | $tdd = 0; | ||||
while ($row = $dsql->GetObject('x')) { | while ($row = $dsql->GetObject('x')) { | ||||
if (DelArc($row->id)) $tdd++; | if (DelArc($row->id)) $tdd++; | ||||
} | } | ||||
ShowMsg(Lang('content_batch_delete_success',array('tdd'=>$tdd)), "javascript:;"); | |||||
ShowMsg("成功删除 $tdd 条记录", "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
//删除空内容文档 | //删除空内容文档 | ||||
else if ($action == 'delnullbody') { | else if ($action == 'delnullbody') { | ||||
$dsql->SetQuery("SELECT aid FROM `#@__addonarticle` WHERE LENGTH(body) < 10"); | |||||
$dsql->SetQuery("SELECT aid FROM `#@__addonarticle` WHERE LENGTH(body) < 10 "); | |||||
$dsql->Execute('x'); | $dsql->Execute('x'); | ||||
$tdd = 0; | $tdd = 0; | ||||
while ($row = $dsql->GetObject('x')) { | while ($row = $dsql->GetObject('x')) { | ||||
if (DelArc($row->aid)) $tdd++; | if (DelArc($row->aid)) $tdd++; | ||||
} | } | ||||
ShowMsg(Lang('content_batch_delete_success',array('tdd'=>$tdd)), "javascript:;"); | |||||
ShowMsg("成功删除 $tdd 条记录", "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
//修正缩略图错误 | //修正缩略图错误 | ||||
else if ($action == 'modddpic') { | else if ($action == 'modddpic') { | ||||
$dsql->ExecuteNoneQuery("UPDATE `#@__archives` SET litpic='' WHERE trim(litpic)='litpic'"); | |||||
ShowMsg(Lang("content_batch_modddpic_success"), "javascript:;"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `#@__archives` SET litpic='' WHERE trim(litpic)='litpic' "); | |||||
ShowMsg("成功修正缩略图错误", "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
//批量移动 | //批量移动 | ||||
else if ($action == 'move') { | else if ($action == 'move') { | ||||
if (empty($typeid)) { | if (empty($typeid)) { | ||||
ShowMsg(Lang('content_batch_err_typeid_isempty'), 'javascript:;'); | |||||
ShowMsg('该操作必须指定栏目', 'javascript:;'); | |||||
exit(); | exit(); | ||||
} | } | ||||
$typeold = $dsql->GetOne("SELECT * FROM `#@__arctype` WHERE id='$typeid';"); | |||||
$typenew = $dsql->GetOne("SELECT * FROM `#@__arctype` WHERE id='$newtypeid';"); | |||||
$typeold = $dsql->GetOne("SELECT * FROM #@__arctype WHERE id='$typeid'; "); | |||||
$typenew = $dsql->GetOne("SELECT * FROM #@__arctype WHERE id='$newtypeid'; "); | |||||
if (!is_array($typenew)) { | if (!is_array($typenew)) { | ||||
ShowMsg(Lang("content_batch_err_typenew"), "javascript:;"); | |||||
ShowMsg("无法检测移动到的新栏目的信息,不能完成操作", "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if ($typenew['ispart'] != 0) { | if ($typenew['ispart'] != 0) { | ||||
ShowMsg(Lang("content_batch_err_ispart"), "javascript:;"); | |||||
ShowMsg("您不能把数据移动到非最终列表的栏目", "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if ($typenew['channeltype'] != $typeold['channeltype']) { | if ($typenew['channeltype'] != $typeold['channeltype']) { | ||||
ShowMsg(Lang("content_batch_err_channeltype"), "javascript:;"); | |||||
ShowMsg("不能把数据移动到内容类型不同的栏目", "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$gwhere .= " And channel='".$typenew['channeltype']."' And title like '%$keyword%'"; | $gwhere .= " And channel='".$typenew['channeltype']."' And title like '%$keyword%'"; | ||||
$ch = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id={$typenew['channeltype']}"); | |||||
$ch = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id={$typenew['channeltype']} "); | |||||
$addtable = $ch['addtable']; | $addtable = $ch['addtable']; | ||||
$dsql->SetQuery("SELECT id FROM `#@__archives` $gwhere"); | $dsql->SetQuery("SELECT id FROM `#@__archives` $gwhere"); | ||||
$dsql->Execute('m'); | $dsql->Execute('m'); | ||||
$tdd = 0; | $tdd = 0; | ||||
@@ -140,7 +144,7 @@ else if ($action == 'move') { | |||||
$rs = $dsql->ExecuteNoneQuery("UPDATE `#@__arctiny` SET typeid='$newtypeid' WHERE id='{$row->id}'"); | $rs = $dsql->ExecuteNoneQuery("UPDATE `#@__arctiny` SET typeid='$newtypeid' WHERE id='{$row->id}'"); | ||||
$rs = $dsql->ExecuteNoneQuery("UPDATE `#@__archives` SET typeid='$newtypeid' WHERE id='{$row->id}'"); | $rs = $dsql->ExecuteNoneQuery("UPDATE `#@__archives` SET typeid='$newtypeid' WHERE id='{$row->id}'"); | ||||
if ($addtable != '') { | if ($addtable != '') { | ||||
$dsql->ExecuteNoneQuery("UPDATE `$addtable` SET typeid='$newtypeid' WHERE aid='{$row->id}'"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `$addtable` SET typeid='$newtypeid' WHERE aid='{$row->id}' "); | |||||
} | } | ||||
if ($rs) $tdd++; | if ($rs) $tdd++; | ||||
//DelArc($row->id,true); | //DelArc($row->id,true); | ||||
@@ -149,20 +153,26 @@ else if ($action == 'move') { | |||||
$jumpurl = "makehtml_archives_action.php?endid=$endid&startid=$startid"; | $jumpurl = "makehtml_archives_action.php?endid=$endid&startid=$startid"; | ||||
$jumpurl .= "&typeid=$newtypeid&pagesize=20&seltime=$seltime"; | $jumpurl .= "&typeid=$newtypeid&pagesize=20&seltime=$seltime"; | ||||
$jumpurl .= "&stime=".urlencode($starttime)."&etime=".urlencode($endtime); | $jumpurl .= "&stime=".urlencode($starttime)."&etime=".urlencode($endtime); | ||||
ShowMsg(Lang('content_batch_move_success',array('tdd'=>$tdd )), $jumpurl); | |||||
ShowMsg("成功移动 $tdd 条记录,准备重新生成网页", $jumpurl); | |||||
} else { | } else { | ||||
ShowMsg(Lang("content_batch_finish_move_success"), "javascript:;"); | |||||
ShowMsg("完成操作,没移动任何数据", "javascript:;"); | |||||
} | } | ||||
} | } | ||||
//删除空标题内容 | //删除空标题内容 | ||||
else if ($action == 'delnulltitle') { | else if ($action == 'delnulltitle') { | ||||
$dsql->SetQuery("SELECT id FROM `#@__archives` WHERE trim(title)=''"); | |||||
$dsql->SetQuery("SELECT id FROM #@__archives WHERE trim(title)='' "); | |||||
$dsql->Execute('x'); | $dsql->Execute('x'); | ||||
$tdd = 0; | $tdd = 0; | ||||
while ($row = $dsql->GetObject('x')) { | while ($row = $dsql->GetObject('x')) { | ||||
if (DelArc($row->id)) $tdd++; | if (DelArc($row->id)) $tdd++; | ||||
} | } | ||||
ShowMsg(Lang('content_batch_delete_success',array('tdd'=>$tdd)), "javascript:;"); | |||||
ShowMsg("成功删除 $tdd 条记录", "javascript:;"); | |||||
exit(); | |||||
} | |||||
//修正缩略图错误 | |||||
else if ($action == 'modddpic') { | |||||
$dsql->ExecuteNoneQuery("UPDATE #@__archives SET litpic='' WHERE trim(litpic)='litpic' "); | |||||
ShowMsg("成功修正缩略图错误", "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
?> | ?> |
@@ -1,7 +1,8 @@ | |||||
<?php | <?php | ||||
/** | /** | ||||
* 内容列表 | * 内容列表 | ||||
* content_s_list.php、content_i_list.php、content_select_list.php均使用本文件作为实际处理代码,只是使用的模板不同,如有相关变动,只需改本文件及相关模板即可 | |||||
* content_s_list.php、content_i_list.php、content_select_list.php | |||||
* 均使用本文件作为实际处理代码,只是使用的模板不同,如有相关变动,只需改本文件及相关模板即可 | |||||
* | * | ||||
* @version $Id: content_list.php 1 14:31 2010年7月12日Z tianya $ | * @version $Id: content_list.php 1 14:31 2010年7月12日Z tianya $ | ||||
* @package DedeBIZ.Administrator | * @package DedeBIZ.Administrator | ||||
@@ -9,10 +10,9 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DataListCP; | |||||
use DedeBIZ\Login\UserLogin; | |||||
use DedeBIZ\TypeLink\TypeLink; | |||||
require_once(dirname(__FILE__).'/config.php'); | require_once(dirname(__FILE__).'/config.php'); | ||||
require_once(DEDEINC.'/typelink/typelink.class.php'); | |||||
require_once(DEDEINC.'/datalistcp.class.php'); | |||||
require_once(DEDEADMIN.'/inc/inc_list_functions.php'); | require_once(DEDEADMIN.'/inc/inc_list_functions.php'); | ||||
$cid = isset($cid) ? intval($cid) : 0; | $cid = isset($cid) ? intval($cid) : 0; | ||||
$channelid = isset($channelid) ? intval($channelid) : 0; | $channelid = isset($channelid) ? intval($channelid) : 0; | ||||
@@ -24,21 +24,21 @@ if (!isset($arcrank)) $arcrank = ''; | |||||
if (!isset($dopost)) $dopost = ''; | if (!isset($dopost)) $dopost = ''; | ||||
$arcrank = RemoveXSS($arcrank); | $arcrank = RemoveXSS($arcrank); | ||||
//检查权限许可,总权限 | //检查权限许可,总权限 | ||||
UserLogin::CheckPurview('a_List,a_AccList,a_MyList'); | |||||
CheckPurview('a_List,a_AccList,a_MyList'); | |||||
//栏目浏览许可 | //栏目浏览许可 | ||||
$userCatalogSql = ''; | $userCatalogSql = ''; | ||||
if (UserLogin::TestPurview('a_List')) {; | |||||
} else if (UserLogin::TestPurview('a_AccList')) { | |||||
if (TestPurview('a_List')) {; | |||||
} else if (TestPurview('a_AccList')) { | |||||
if ($cid == 0 && $cfg_admin_channel == 'array') { | if ($cid == 0 && $cfg_admin_channel == 'array') { | ||||
$admin_catalog = join(',', $admin_catalogs); | $admin_catalog = join(',', $admin_catalogs); | ||||
$userCatalogSql = " arc.typeid IN($admin_catalog) "; | $userCatalogSql = " arc.typeid IN($admin_catalog) "; | ||||
} else { | } else { | ||||
UserLogin::CheckCatalog($cid, Lang('catalog_err_norank')); | |||||
CheckCatalog($cid, '您无权浏览非指定栏目的内容'); | |||||
} | } | ||||
if (UserLogin::TestPurview('a_MyList')) $mid = $cUserLogin->getUserID(); | |||||
if (TestPurview('a_MyList')) $mid = $cuserLogin->getUserID(); | |||||
} | } | ||||
$adminid = $cUserLogin->getUserID(); | |||||
$adminid = $cuserLogin->getUserID(); | |||||
$maintable = '#@__archives'; | $maintable = '#@__archives'; | ||||
setcookie('ENV_GOBACK_URL', $dedeNowurl, time() + 3600, '/'); | setcookie('ENV_GOBACK_URL', $dedeNowurl, time() + 3600, '/'); | ||||
$tl = new TypeLink($cid); | $tl = new TypeLink($cid); | ||||
@@ -74,7 +74,7 @@ if (empty($totalresult) && empty($keyword) && empty($orderby) && empty($flag)) { | |||||
} | } | ||||
if ($cid == 0) { | if ($cid == 0) { | ||||
if ($channelid == 0) { | if ($channelid == 0) { | ||||
$positionname = Lang('catalog_all').'>'; | |||||
$positionname = '所有栏目>'; | |||||
} else { | } else { | ||||
$row = $tl->dsql->GetOne("SELECT id,typename,maintable FROM `#@__channeltype` WHERE id='$channelid'"); | $row = $tl->dsql->GetOne("SELECT id,typename,maintable FROM `#@__channeltype` WHERE id='$channelid'"); | ||||
$positionname = $row['typename']." > "; | $positionname = $row['typename']." > "; | ||||
@@ -112,7 +112,7 @@ if ($typeCount > 800) { | |||||
} else { | } else { | ||||
$optionarr = $tl->GetOptionArray($cid, $admin_catalogs, $channelid); | $optionarr = $tl->GetOptionArray($cid, $admin_catalogs, $channelid); | ||||
} | } | ||||
$whereSql = empty($channelid) ? " WHERE arc.channel > 0 AND arc.arcrank > -2 " : " WHERE arc.channel = '$channelid' AND arc.arcrank > -2 "; | |||||
$whereSql = empty($channelid) ? " WHERE arc.channel > 0 AND arc.arcrank > -2 " : " WHERE arc.channel = '$channelid' AND arc.arcrank > -2 "; | |||||
$flagsArr = ''; | $flagsArr = ''; | ||||
$dsql->Execute('f', 'SELECT * FROM `#@__arcatt` ORDER BY sortid ASC'); | $dsql->Execute('f', 'SELECT * FROM `#@__arcatt` ORDER BY sortid ASC'); | ||||
while ($frow = $dsql->GetArray('f')) { | while ($frow = $dsql->GetArray('f')) { | ||||
@@ -135,9 +135,9 @@ if ($cid != 0) { | |||||
} | } | ||||
if ($arcrank != '') { | if ($arcrank != '') { | ||||
$whereSql .= " AND arc.arcrank = '$arcrank' "; | $whereSql .= " AND arc.arcrank = '$arcrank' "; | ||||
$CheckUserSend = "<button type='button' class='btn btn-success btn-sm' onClick=\"location='catalog_do.php?cid=".$cid."&dopost=listArchives&gurl=content_list.php';\">".Lang('content_list_all')."</button>"; | |||||
$CheckUserSend = "<button type='button' class='btn btn-success btn-sm' onClick=\"location='catalog_do.php?cid=".$cid."&dopost=listArchives&gurl=content_list.php';\">所有文档</button>"; | |||||
} else { | } else { | ||||
$CheckUserSend = "<button type='button' class='btn btn-success btn-sm' onClick=\"location='catalog_do.php?cid=".$cid."&dopost=listArchives&arcrank=-1&gurl=content_list.php';\">".Lang('content_uncheck')."</button>"; | |||||
$CheckUserSend = "<button type='button' class='btn btn-success btn-sm' onClick=\"location='catalog_do.php?cid=".$cid."&dopost=listArchives&arcrank=-1&gurl=content_list.php';\">稿件审核</button>"; | |||||
} | } | ||||
$orderby = empty($orderby) ? 'id' : preg_replace("#[^a-z0-9]#", "", $orderby); | $orderby = empty($orderby) ? 'id' : preg_replace("#[^a-z0-9]#", "", $orderby); | ||||
$orderbyField = 'arc.'.$orderby; | $orderbyField = 'arc.'.$orderby; | ||||
@@ -8,9 +8,8 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('spec_List'); | |||||
CheckPurview('spec_List'); | |||||
$s_tmplets = "templets/content_s_list.htm"; | $s_tmplets = "templets/content_s_list.htm"; | ||||
$channelid = -1; | $channelid = -1; | ||||
include(dirname(__FILE__)."/content_list.php"); | include(dirname(__FILE__)."/content_list.php"); |
@@ -8,9 +8,6 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DataListCP; | |||||
use DedeBIZ\Login\UserLogin; | |||||
use DedeBIZ\TypeLink\TypeLink; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
$cid = isset($cid) ? intval($cid) : 0; | $cid = isset($cid) ? intval($cid) : 0; | ||||
$channelid = isset($channelid) ? intval($channelid) : 0; | $channelid = isset($channelid) ? intval($channelid) : 0; | ||||
@@ -18,28 +15,30 @@ $mid = isset($mid) ? intval($mid) : 0; | |||||
if (!isset($keyword)) $keyword = ''; | if (!isset($keyword)) $keyword = ''; | ||||
if (!isset($arcrank)) $arcrank = ''; | if (!isset($arcrank)) $arcrank = ''; | ||||
if (empty($cid) && empty($channelid)) { | if (empty($cid) && empty($channelid)) { | ||||
ShowMsg(Lang("content_err_cid_channelid_isempty"), "javascript:;"); | |||||
ShowMsg("该页面必须指定栏目id或内容模型ID才能浏览", "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
//检查权限许可,总权限 | //检查权限许可,总权限 | ||||
UserLogin::CheckPurview('a_List,a_AccList,a_MyList'); | |||||
CheckPurview('a_List,a_AccList,a_MyList'); | |||||
//栏目浏览许可 | //栏目浏览许可 | ||||
if (UserLogin::TestPurview('a_List')) { | |||||
} else if (UserLogin::TestPurview('a_AccList')) { | |||||
if (TestPurview('a_List')) { | |||||
} else if (TestPurview('a_AccList')) { | |||||
if ($cid == 0) { | if ($cid == 0) { | ||||
$ucid = $cid = $cUserLogin->getUserChannel(); | |||||
$ucid = $cid = $cuserLogin->getUserChannel(); | |||||
} else { | } else { | ||||
UserLogin::CheckCatalog($cid, Lang("catalog_err_norank")); | |||||
CheckCatalog($cid, "您无权浏览非指定栏目的内容"); | |||||
} | } | ||||
} | } | ||||
$adminid = $cUserLogin->getUserID(); | |||||
$adminid = $cuserLogin->getUserID(); | |||||
$maintable = '#@__archives'; | $maintable = '#@__archives'; | ||||
require_once(DEDEINC."/typelink/typelink.class.php"); | |||||
require_once(DEDEINC."/datalistcp.class.php"); | |||||
require_once(DEDEADMIN."/inc/inc_list_functions.php"); | require_once(DEDEADMIN."/inc/inc_list_functions.php"); | ||||
setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/"); | setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/"); | ||||
$tl = new TypeLink($cid); | $tl = new TypeLink($cid); | ||||
$listtable = @trim($tl->TypeInfos['addtable']); | $listtable = @trim($tl->TypeInfos['addtable']); | ||||
if (!empty($channelid) && !empty($ucid) && $tl->TypeInfos['channeltype'] != $channelid) { | if (!empty($channelid) && !empty($ucid) && $tl->TypeInfos['channeltype'] != $channelid) { | ||||
ShowMsg(Lang('catalog_err_noperm'), 'javascript:;'); | |||||
ShowMsg('您没权限访问此页', 'javascript:;'); | |||||
exit(); | exit(); | ||||
} | } | ||||
if ($cid == 0) { | if ($cid == 0) { | ||||
@@ -53,12 +52,12 @@ $optionarr = $tl->GetOptionArray($cid, $admin_catalogs, $channelid); | |||||
$whereSql = $channelid == 0 ? " WHERE arc.channel < -1 " : " WHERE arc.channel = '$channelid' "; | $whereSql = $channelid == 0 ? " WHERE arc.channel < -1 " : " WHERE arc.channel = '$channelid' "; | ||||
if (!empty($mid)) $whereSql .= " AND arc.mid = '$mid' "; | if (!empty($mid)) $whereSql .= " AND arc.mid = '$mid' "; | ||||
if ($keyword != '') $whereSql .= " AND (arc.title like '%$keyword%') "; | if ($keyword != '') $whereSql .= " AND (arc.title like '%$keyword%') "; | ||||
if ($cid != 0) $whereSql .= " AND arc.typeid in (".GetSonIds($cid).") "; | |||||
if ($cid != 0) $whereSql .= " AND arc.typeid in (".GetSonIds($cid).")"; | |||||
if ($arcrank != '') { | if ($arcrank != '') { | ||||
$whereSql .= " AND arc.arcrank = '$arcrank' "; | $whereSql .= " AND arc.arcrank = '$arcrank' "; | ||||
$CheckUserSend = "<button type='button' class='btn btn-success btn-sm' onClick=\"location='content_sg_list.php?cid={$cid}&channelid={$channelid}&dopost=listArchives';\">".Lang('content_list_all')."</button>"; | |||||
$CheckUserSend = "<button type='button' class='btn btn-success btn-sm' onClick=\"location='content_sg_list.php?cid={$cid}&channelid={$channelid}&dopost=listArchives';\">所有文档</button>"; | |||||
} else { | } else { | ||||
$CheckUserSend = "<button type='button' class='btn btn-success btn-sm' onClick=\"location='content_sg_list.php?cid={$cid}&channelid={$channelid}&dopost=listArchives&arcrank=-1';\">".Lang('content_uncheck')."</button>"; | |||||
$CheckUserSend = "<button type='button' class='btn btn-success btn-sm' onClick=\"location='content_sg_list.php?cid={$cid}&channelid={$channelid}&dopost=listArchives&arcrank=-1';\">稿件审核</button>"; | |||||
} | } | ||||
$query = "SELECT arc.aid,arc.aid as id,arc.typeid,arc.arcrank,arc.flag,arc.senddate,arc.channel,arc.title,arc.mid,arc.click,tp.typename,ch.typename as channelname FROM `$listtable` arc LEFT JOIN `#@__arctype` tp ON tp.id=arc.typeid LEFT JOIN `#@__channeltype` ch ON ch.id=arc.channel $whereSql ORDER BY arc.aid DESC"; | $query = "SELECT arc.aid,arc.aid as id,arc.typeid,arc.arcrank,arc.flag,arc.senddate,arc.channel,arc.title,arc.mid,arc.click,tp.typename,ch.typename as channelname FROM `$listtable` arc LEFT JOIN `#@__arctype` tp ON tp.id=arc.typeid LEFT JOIN `#@__channeltype` ch ON ch.id=arc.channel $whereSql ORDER BY arc.aid DESC"; | ||||
$dlist = new DataListCP(); | $dlist = new DataListCP(); | ||||
@@ -8,12 +8,11 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('sys_ArcTj'); | |||||
$row1 = $dsql->GetOne("SELECT COUNT(*) AS dd FROM `#@__arctiny`"); | |||||
$row2 = $dsql->GetOne("SELECT COUNT(*) AS dd FROM `#@__feedback`"); | |||||
$row3 = $dsql->GetOne("SELECT COUNT(*) AS dd FROM `#@__member`"); | |||||
CheckPurview('sys_ArcTj'); | |||||
$row1 = $dsql->GetOne("SELECT COUNT(*) AS dd FROM `#@__arctiny` "); | |||||
$row2 = $dsql->GetOne("SELECT COUNT(*) AS dd FROM `#@__feedback` "); | |||||
$row3 = $dsql->GetOne("SELECT COUNT(*) AS dd FROM `#@__member` "); | |||||
/** | /** | ||||
* 获取文档 | * 获取文档 | ||||
* | * | ||||
@@ -34,14 +33,14 @@ function GetArchives($dsql, $ordertype) | |||||
} else { | } else { | ||||
$ordersql = " ORDER BY click DESC "; | $ordersql = " ORDER BY click DESC "; | ||||
} | } | ||||
$query = "SELECT id,title,click,scores FROM `#@__archives` $swhere $ordersql LIMIT 0,20"; | |||||
$query = "SELECT id,title,click,scores FROM `#@__archives` $swhere $ordersql LIMIT 0,30 "; | |||||
$dsql->SetQuery($query); | $dsql->SetQuery($query); | ||||
$dsql->Execute('ga'); | $dsql->Execute('ga'); | ||||
while ($row = $dsql->GetObject('ga')) { | while ($row = $dsql->GetObject('ga')) { | ||||
if (preg_match("#feedback#i", $ordertype)) { | if (preg_match("#feedback#i", $ordertype)) { | ||||
$moreinfo = "[<a target='_blank' href='".$GLOBALS['cfg_phpurl']."/feedback.php?aid={$row->id}'>".Lang('feedback').":{$row->scores}</a>]"; | |||||
$moreinfo = "[<a target='_blank' href='".$GLOBALS['cfg_phpurl']."/feedback.php?aid={$row->id}'>评论:{$row->scores}</a>]"; | |||||
} else { | } else { | ||||
$moreinfo = "[".Lang('click').":{$row->click}]"; | |||||
$moreinfo = "[点击:{$row->click}]"; | |||||
} | } | ||||
echo "·<a href='archives_do.php?aid={$row->id}&dopost=viewArchives' target='_blank'>"; | echo "·<a href='archives_do.php?aid={$row->id}&dopost=viewArchives' target='_blank'>"; | ||||
echo cn_substr($row->title, 30)."</a>{$moreinfo}<br>\r\n"; | echo cn_substr($row->title, 30)."</a>{$moreinfo}<br>\r\n"; | ||||
@@ -1 +0,0 @@ | |||||
div.flash{margin:10px 5px;width:375px;border-color:#D9E4FF;border-radius:.2rem}#btnSubmit{margin:0 0 0 150px}.progressWrapper{width:360px;overflow:hidden}.progressContainer{padding:5px;margin:5px;background:#f8f8f8;border:solid 1px #E8E8E8;overflow:hidden}.message{margin:10px 0;padding:10px 20px;background:#FFC;border:solid 1px #FD9;overflow:hidden}.red{background:#FFEBEB;border:solid 1px #B50000}.green{background:#EBFFEB;border:solid 1px #DDF0DD}.blue{background:#F0F5FF;border:solid 1px #CEE2F2}.progressName{width:320px;height:16px;text-align:left;white-space:nowrap;overflow:hidden}.progressBarInProgress,.progressBarComplete,.progressBarError{margin-top:2px;width:0;height:2px;font-size:0;background:blue}.progressBarComplete{width:100%;background:green;visibility:hidden}.progressBarError{width:100%;background:#dc3545;visibility:hidden}.progressBarStatus{margin-top:2px;width:340px;text-align:left;white-space:nowrap}.swfupload{vertical-align:top}.albCt{float:left;width:220px;height:auto;margin-right:10px;margin-bottom:10px;border:1px dashed #eee;background:#f8f8f8;text-align:center;padding:10px}.albEdit{height:auto}.picinfo{height:30px;line-height:30px;margin:10px 0}.thumbnails img,.thumbnailsEdit img{margin:5px}.albCt img{max-width:200px;max-height:150px;cursor:pointer} |
@@ -1 +0,0 @@ | |||||
*{margin:0;padding:0;letter-spacing:.4px;box-sizing:border-box}body{line-height:1.5;font:14px Helvetica Neue,Helvetica,PingFang SC,Tahoma,Arial,sans-serif;color:#545b62;background:#f8f8f8}a{color:#545b62}h2{font-size:24px}input,select,.btn{font-size:14px!important}.biz-head{padding:1rem 0;background:#fff}.logo{height:36px}.biz-nav{height:36px;line-height:36px}.biz-nav-a{padding-right:30px}.biz-btn{color:#545b62}.dropdown-menu{min-width:8rem;font-size:14px}.dropdown-item{padding:0 1rem;height:30px;line-height:30px;font-size:14px;color:#545b62!important}.login-from{margin:0 auto;width:500px}.login-area{padding:1.25rem;background:#fff;border-radius:.2rem}.login-power{padding-top:1rem}.login-power a,.goindex a{color:#1eb867}.form-control{height:36px}#browsehappy{padding:20px 30px;font-size:14px;line-height:16px;color:#856404;background:#fff3cd;border-radius:.25rem;border:0}.browsehappy-close{float:right;cursor:pointer}@media (max-width:760px){.biz-head{padding:1rem 15px}.biz-nav-a{display:none!important}.login-from{width:100%}} |
@@ -1 +0,0 @@ | |||||
*{font-size:12px;letter-spacing:.4px}body{font:12px Helvetica Neue,Helvetica,PingFang SC,Tahoma,Arial,sans-serif;color:#545b62;background:#fff}body.hidemenu{background:none}body.showmenu .index-menu{display:block}body.hidemenu .index-menu{display:none}body.showmenu .index-body{left:230px;transition:all .3s}body.hidemenu .index-body{left:0;transition:all .3s}a,a:hover{text-decoration:none}ul,li{list-style:none}.index-menu{position:absolute;top:60px;width:230px;left:0;bottom:0;z-index:1}.index-body{position:absolute;right:0;top:60px;bottom:0;z-index:1}.main{height:100%}.main iframe{width:100%;height:100%;z-index:20}.menu{height:100%}.menu iframe{width:100%;height:100%;z-index:3}.head{position:relative;width:100%;height:60px;z-index:2}.top{width:100%;height:60px;background:linear-gradient(45deg,#1eb867,#009688);box-shadow:0 0.125rem 0.25rem rgba(0,0,0,.075);}.top .top-logo{float:left;margin-left:30px;width:200px}.top .top-dedebiz a{float:left;height:60px;line-height:60px;font-size:18px;font-weight:600;color:#fff}.top .top-dedebiz a img{width:90px}.top .top-version a{float:left;height:60px;line-height:60px;font-size:18px;font-weight:600;color:#fff}.top .top-version{float:left;margin-top:20px;margin-left:10px;font-size:12px;color:#fff}.top .btn-primary{float:left;margin-top:18px;margin-left:10px;padding:2px;line-height:12px;font-size:12px;color:#fff}.top .btn-warning{float:left;margin-top:18px;margin-left:10px;padding:2px;line-height:12px;font-size:12px;color:#fff}.top .top-item ul li{float:left;padding-left:30px;height:60px;line-height:60px}.top .top-item ul li a,.top .top-admin ul li a{font-size:14px;color:#fff}.top .top-item ul li a:hover,.top .top-admin ul li a:hover{color:#dee2e6}.top .top-admin{float:right;margin-right:30px;height:60px;line-height:60px}.top .top-admin img{margin-right:10px;width:30px;height:30px;border-radius:50%}.top .top-admin ul li{float:left;padding-left:30px;height:60px;line-height:60px}.form-search{width:170px}.input-search{width:160px;height:26px;line-height:26px;font-size:12px;background:#fff;border-radius:.2rem;border:0;vertical-align:middle}.input-search:focus{box-shadow:none;outline:none}.btn-search{margin-left:-30px;height:26px;line-height:26px;color:#545b62;background:transparent;border-radius:.2rem;border:0}.btn{font-size:14px;color:#fff}.btn:hover{color:#fff}.dropdown-menu{min-width:8rem}.dropdown-item{padding:0 1rem;height:36px;line-height:36px;font-size:14px;color:#545b62!important}.accordion-box{margin:0;padding:1rem 8px;background:#f8f8f8;overflow:scroll;overflow-x:hidden}.accordion{width:100%;background:#fff;border-radius:.2rem;box-shadow:0 .125rem .25rem rgba(0,0,0,.075)}.accordion .link{position:relative;padding-left:50px;display:block;height:40px;line-height:40px;cursor:pointer;transition:all .3s;}.accordion li:last-child .link{border-bottom:0}.accordion li i{position:absolute;top:12px;left:20px;color:#545b62;}.accordion li i.fa-angle-down{right:20px;left:auto;}.accordion li.open .link,.accordion li.open i{color:#1eb867}.accordion li.open i.fa-angle-down{transform:rotate(180deg)}.submenu{display:none;padding:6px 0;background:#adb5bd;border-radius:0 0 .2rem .2rem}.submenu li{height:40px;line-height:40px;transition:all .3s}.submenu li:hover{background:#1eb867}.submenu a{display:block;float:left;padding:0 10px 0 50px;color:#fff}.submenu-right{float:right!important;padding:0 20px 0 10px!important;}#browsehappy{padding:20px 30px;font-size:14px;line-height:16px;color:#856404;background:#fff3cd;border-radius:.25rem;border:0}.browsehappy-close{float:right;cursor:pointer} |
@@ -2,15 +2,14 @@ | |||||
/** | /** | ||||
* 该页仅用于检测用户登录的情况,如要手工修改系统配置,请修改common.inc.php | * 该页仅用于检测用户登录的情况,如要手工修改系统配置,请修改common.inc.php | ||||
* | * | ||||
* @version $Id: config.php 2022-07-01 tianya $ | |||||
* @version $Id: config.php 1 9:43 2010年7月8日Z tianya $ | |||||
* @package DedeBIZ.Dialog | * @package DedeBIZ.Dialog | ||||
* @copyright Copyright (c) 2022, DedeBIZ.COM | * @copyright Copyright (c) 2022, DedeBIZ.COM | ||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
define('LANGSECTION', 'admin'); | |||||
require_once(dirname(__FILE__)."/../../system/common.inc.php"); | require_once(dirname(__FILE__)."/../../system/common.inc.php"); | ||||
require_once(DEDEINC."/userlogin.class.php"); | |||||
//获得当前脚本名称,如果您的系统被禁用了$_SERVER变量,请自行修改这个选项 | //获得当前脚本名称,如果您的系统被禁用了$_SERVER变量,请自行修改这个选项 | ||||
$dedeNowurl = ''; | $dedeNowurl = ''; | ||||
$s_scriptName = ''; | $s_scriptName = ''; | ||||
@@ -19,10 +18,10 @@ $dedeNowurl = GetCurUrl(); | |||||
$dedeNowurls = explode("?", $dedeNowurl); | $dedeNowurls = explode("?", $dedeNowurl); | ||||
$s_scriptName = $dedeNowurls[0]; | $s_scriptName = $dedeNowurls[0]; | ||||
//检验用户登录状态 | //检验用户登录状态 | ||||
$cUserLogin = new UserLogin(); | |||||
if ($cUserLogin->getUserID() <= 0) { | |||||
$cuserLogin = new userLogin(); | |||||
if ($cuserLogin->getUserID() <= 0) { | |||||
if (empty($adminDirHand)) { | if (empty($adminDirHand)) { | ||||
ShowMsg(Lang("dialog_nologin"), "javascript:;"); | |||||
ShowMsg("提示:需输入后台管理目录才能登录<br><form>请输入后台管理目录名:<input type='hidden' name='gotopage' value='".urlencode($dedeNowurl)."' /><input type='text' name='adminDirHand' value='dede' style='width:120px;' /><input style='width:80px;' type='submit' name='sbt' value='转入登录' /></form>", "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$adminDirHand = HtmlReplace($adminDirHand, 1); | $adminDirHand = HtmlReplace($adminDirHand, 1); | ||||
@@ -24,7 +24,7 @@ if (strlen($activepath) < strlen($cfg_image_dir)) { | |||||
$activepath = $cfg_image_dir; | $activepath = $cfg_image_dir; | ||||
} | } | ||||
$inpath = $cfg_basedir.$activepath; | $inpath = $cfg_basedir.$activepath; | ||||
$activeurl = $activepath; | |||||
$activeurl = '..'.$activepath; | |||||
if (empty($f)) { | if (empty($f)) { | ||||
$f = 'form1.picname'; | $f = 'form1.picname'; | ||||
} | } | ||||
@@ -53,16 +53,17 @@ if (!empty($iseditor)) { | |||||
<!DOCTYPE html> | <!DOCTYPE html> | ||||
<html> | <html> | ||||
<head> | <head> | ||||
<meta charset="utf-8"> | |||||
<meta charset="<?php echo $cfg_soft_lang;?>"> | |||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> | <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> | ||||
<title><?php echo Lang('dialog_select_image');?></title> | |||||
<title>选择图片</title> | |||||
<link rel="stylesheet" href="../../static/web/css/bootstrap.min.css"> | <link rel="stylesheet" href="../../static/web/css/bootstrap.min.css"> | ||||
<link rel="stylesheet" href="../../static/web/font/css/font-awesome.min.css"> | <link rel="stylesheet" href="../../static/web/font/css/font-awesome.min.css"> | ||||
<link rel="stylesheet" href="../../static/web/css/admin.min.css"> | |||||
<link rel="stylesheet" href="../../static/web/css/admin.css"> | |||||
<style> | <style> | ||||
html{background:#f8f8f8} | |||||
.bg{margin:10px;border-radius:.2rem;box-shadow:0 .125rem .25rem rgba(0,0,0,.075)} | |||||
html{background:#f6f6f6} | |||||
.bg{margin:10px;border-radius:.2rem;box-shadow:0 1px 2px 0 rgba(0,0,0,.05)} | |||||
.napisdiv{left:10;top:10;width:150px;height:100px;position:absolute;z-index:3;display:none} | .napisdiv{left:10;top:10;width:150px;height:100px;position:absolute;z-index:3;display:none} | ||||
.linerow{border-bottom:1px solid #eee!important} | |||||
</style> | </style> | ||||
<script> | <script> | ||||
function nullLink() { | function nullLink() { | ||||
@@ -74,6 +75,9 @@ html{background:#f8f8f8} | |||||
</script> | </script> | ||||
</head> | </head> | ||||
<body class="bg"> | <body class="bg"> | ||||
<div id="floater" class="napisdiv"> | |||||
<a href="javascript:nullLink();" onClick="document.getElementById('floater').style.display='none';"><img src="../../static/web/img/picviewnone.gif" id="picview" title="关闭预览"></a> | |||||
</div> | |||||
<script src="../js/float.js"></script> | <script src="../js/float.js"></script> | ||||
<script> | <script> | ||||
function nullLink() { | function nullLink() { | ||||
@@ -90,7 +94,7 @@ html{background:#f8f8f8} | |||||
} | } | ||||
//获取地址参数 | //获取地址参数 | ||||
function getUrlParam(paramName) { | function getUrlParam(paramName) { | ||||
var reParam = new RegExp('(?:[\?&]|&)' + paramName + '=([^&]+)','i'); | |||||
var reParam = new RegExp('(?:[\?&]|&)' + paramName + '=([^&]+)', 'i'); | |||||
var match = window.location.search.match(reParam); | var match = window.location.search.match(reParam); | ||||
return (match && match.length > 1) ? match[1] : ''; | return (match && match.length > 1) ? match[1] : ''; | ||||
} | } | ||||
@@ -131,12 +135,9 @@ html{background:#f8f8f8} | |||||
window.close(); | window.close(); | ||||
} | } | ||||
</script> | </script> | ||||
<div id="floater" class="napisdiv"> | |||||
<a href="javascript:nullLink();" onClick="document.getElementById('floater').style.display='none';"><img src="" id="picview" title="关闭预览"></a> | |||||
</div> | |||||
<table width="100%" align="center" cellpadding="0" cellspacing="1" class="table table-borderless"> | |||||
<table width="100%" cellpadding="0" cellspacing="1" align="center" class="table table-borderless"> | |||||
<tr> | <tr> | ||||
<td colspan="4"> | |||||
<td colspan="4" height="26"> | |||||
<form action="select_images_post.php" method="POST" enctype="multipart/form-data" name="myform"> | <form action="select_images_post.php" method="POST" enctype="multipart/form-data" name="myform"> | ||||
<?php $noeditor = !empty($noeditor) ? "<input type='hidden' name='noeditor' value='yes'>" : ''; echo $noeditor;?> | <?php $noeditor = !empty($noeditor) ? "<input type='hidden' name='noeditor' value='yes'>" : ''; echo $noeditor;?> | ||||
<input type="hidden" name="activepath" value="<?php echo $activepath ?>"> | <input type="hidden" name="activepath" value="<?php echo $activepath ?>"> | ||||
@@ -145,22 +146,23 @@ html{background:#f8f8f8} | |||||
<input type="hidden" name="imgstick" value="<?php echo $imgstick ?>"> | <input type="hidden" name="imgstick" value="<?php echo $imgstick ?>"> | ||||
<input type="hidden" name="CKEditorFuncNum" value="<?php echo isset($CKEditorFuncNum) ? $CKEditorFuncNum : 1;?>"> | <input type="hidden" name="CKEditorFuncNum" value="<?php echo isset($CKEditorFuncNum) ? $CKEditorFuncNum : 1;?>"> | ||||
<input type="hidden" name="job" value="upload"> | <input type="hidden" name="job" value="upload"> | ||||
<?php echo Lang('upload');?>:<input type="file" name="imgfile" style="width:46%;border:0"> | |||||
<label><input type="checkbox" name="needwatermark" value="1" <?php if ($photo_markup == '1') echo "checked";?> /> <?php echo Lang('watermark');?></label> | |||||
<label><input type="checkbox" name="resize" value="1"> <?php echo Lang('zoom_out');?></label> | |||||
<?php echo Lang('width');?>:<input type="text" name="iwidth" value="<?php echo $cfg_ddimg_width ?>" style="width:46px"> | |||||
<?php echo Lang('height');?>:<input type="text" name="iheight" value="<?php echo $cfg_ddimg_height ?>" style="width:46px"> | |||||
<button type="submit" name="sb1" class="btn btn-success btn-sm"><?php echo Lang('upload');?></button> | |||||
上传:<input type="file" name="imgfile" style="width:50%;border:none"> | |||||
<label><input type="checkbox" name="needwatermark" value="1" class="np" <?php if ($photo_markup == '1') echo "checked";?> /> 水印 </label> | |||||
<label><input type="checkbox" name="resize" value="1" class="np"> 缩小 </label> | |||||
宽:<input type="text" name="iwidth" value="<?php echo $cfg_ddimg_width ?>" style="width:46px"> | |||||
高:<input type="text" name="iheight" value="<?php echo $cfg_ddimg_height ?>" style="width:46px"> | |||||
<button type="submit" name="sb1" class="btn btn-success btn-sm">上传</button> | |||||
</form> | </form> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td width="50%" class="linerow"><?php echo Lang('preview');?><?php echo Lang('dialog_select_image');?></td> | |||||
<td width="25%" class="linerow"><?php echo Lang('dialog_filesize');?></td> | |||||
<td width="25%" class="linerow"><?php echo Lang('edit_time');?></td> | |||||
<td width="8%" class="linerow">预览</td> | |||||
<td width="40%" class="linerow">选择图片</td> | |||||
<td width="22%" class="linerow">文件大小</td> | |||||
<td width="30%" class="linerow">修改时间</td> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td class="linerow" colspan="4"><?php echo Lang('dialog_select_image_tip');?></td> | |||||
<td class="linerow" colspan="4">点击图片预览,点击图片名选择图片,显示图片后点击该图片关闭预览</td> | |||||
</tr> | </tr> | ||||
<?php | <?php | ||||
$dh = scandir($inpath); | $dh = scandir($inpath); | ||||
@@ -187,15 +189,17 @@ html{background:#f8f8f8} | |||||
if ($activepath == "") continue; | if ($activepath == "") continue; | ||||
$tmp = preg_replace("#[\/][^\/]*$#i", "", $activepath); | $tmp = preg_replace("#[\/][^\/]*$#i", "", $activepath); | ||||
$line = "<tr> | $line = "<tr> | ||||
<td class='linerow' colspan='2'><a href='select_images.php?imgstick=$imgstick&v=$v&f=$f&activepath=".urlencode($tmp).$addparm."'><svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' class='bi bi-folder-symlink' viewBox='0 0 18 18'><path d='m11.798 8.271-3.182 1.97c-.27.166-.616-.036-.616-.372V9.1s-2.571-.3-4 2.4c.571-4.8 3.143-4.8 4-4.8v-.769c0-.336.346-.538.616-.371l3.182 1.969c.27.166.27.576 0 .742z'/><path d='m.5 3 .04.87a1.99 1.99 0 0 0-.342 1.311l.637 7A2 2 0 0 0 2.826 14h10.348a2 2 0 0 0 1.991-1.819l.637-7A2 2 0 0 0 13.81 3H9.828a2 2 0 0 1-1.414-.586l-.828-.828A2 2 0 0 0 6.172 1H2.5a2 2 0 0 0-2 2zm.694 2.09A1 1 0 0 1 2.19 4h11.62a1 1 0 0 1 .996 1.09l-.636 7a1 1 0 0 1-.996.91H2.826a1 1 0 0 1-.995-.91l-.637-7zM6.172 2a1 1 0 0 1 .707.293L7.586 3H2.19c-.24 0-.47.042-.683.12L1.5 2.98a1 1 0 0 1 1-.98h3.672z'/></svg>".Lang('parent_directory')."</a></td> | |||||
<td colspan='2' class='linerow'>".Lang('current_directory').":$activepath</td> | |||||
<td class='linerow' colspan='2'> | |||||
<a href='select_images.php?imgstick=$imgstick&v=$v&f=$f&activepath=".urlencode($tmp).$addparm."'><img src='../../static/web/img/dir2.gif'>上级目录</a></td> | |||||
<td colspan='2' class='linerow'>当前目录:$activepath</td> | |||||
</tr>"; | </tr>"; | ||||
echo $line; | echo $line; | ||||
} else if (is_dir("$inpath/$file")) { | } else if (is_dir("$inpath/$file")) { | ||||
if (preg_match("#^_(.*)$#i", $file)) continue; | if (preg_match("#^_(.*)$#i", $file)) continue; | ||||
if (preg_match("#^\.(.*)$#i", $file)) continue; | if (preg_match("#^\.(.*)$#i", $file)) continue; | ||||
$line = "<tr> | $line = "<tr> | ||||
<td class='linerow' colspan='2'><a href='select_images.php?imgstick=$imgstick&v=$v&f=$f&activepath=".urlencode("$activepath/$file").$addparm."'><svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' class='bi bi-folder' viewBox='0 0 18 18'><path d='M.54 3.87.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3h3.982a2 2 0 0 1 1.992 2.181l-.637 7A2 2 0 0 1 13.174 14H2.826a2 2 0 0 1-1.991-1.819l-.637-7a1.99 1.99 0 0 1 .342-1.31zM2.19 4a1 1 0 0 0-.996 1.09l.637 7a1 1 0 0 0 .995.91h10.348a1 1 0 0 0 .995-.91l.637-7A1 1 0 0 0 13.81 4H2.19zm4.69-1.707A1 1 0 0 0 6.172 2H2.5a1 1 0 0 0-1 .981l.006.139C1.72 3.042 1.95 3 2.19 3h5.396l-.707-.707z'/></svg>$file</a></td> | |||||
<td class='linerow' colspan='2'> | |||||
<a href='select_images.php?imgstick=$imgstick&v=$v&f=$f&activepath=".urlencode("$activepath/$file").$addparm."'><img src='../../static/web/img/dir.gif'>$file</a></td> | |||||
<td class='linerow'></td> | <td class='linerow'></td> | ||||
<td class='linerow'></td> | <td class='linerow'></td> | ||||
</tr>"; | </tr>"; | ||||
@@ -207,7 +211,8 @@ html{background:#f8f8f8} | |||||
if ($file == $comeback) $lstyle = " class='text-danger' "; | if ($file == $comeback) $lstyle = " class='text-danger' "; | ||||
else $lstyle = ""; | else $lstyle = ""; | ||||
$line = "<tr> | $line = "<tr> | ||||
<td class='linerow'><a href=\"javascript:;\" onClick=\"ChangeImage('$reurl');\"><img src='$activeurl/$file' class='file-icon'></a><a href=\"javascript:;\" onclick=\"ReturnImg('$reurl');\" $lstyle>$file</a></td> | |||||
<td class='linerow'><a href=\"#\" onClick=\"ChangeImage('$reurl');\"><img src='../../static/web/img/picviewnone.gif'></a></td> | |||||
<td class='linerow'><a href=# onclick=\"ReturnImg('$reurl');\" $lstyle><img src='../../static/web/img/gif.gif'>$file</a></td> | |||||
<td class='linerow'>$filesize KB</td> | <td class='linerow'>$filesize KB</td> | ||||
<td class='linerow'>$filetime</td> | <td class='linerow'>$filetime</td> | ||||
</tr>"; | </tr>"; | ||||
@@ -219,7 +224,8 @@ html{background:#f8f8f8} | |||||
if ($file == $comeback) $lstyle = " class='text-danger' "; | if ($file == $comeback) $lstyle = " class='text-danger' "; | ||||
else $lstyle = ""; | else $lstyle = ""; | ||||
$line = "<tr> | $line = "<tr> | ||||
<td class='linerow'><a href=\"javascript:;\" onClick=\"ChangeImage('$reurl');\"><img src='$activeurl/$file' class='file-icon'></a><a href=\"javascript:;\" onclick=\"ReturnImg('$reurl');\" $lstyle>$file</a></td> | |||||
<td class='linerow'><a href=\"#\" onClick=\"ChangeImage('$reurl');\"><img src='../../static/web/img/picviewnone.gif'></a></td> | |||||
<td class='linerow'><a href=# onclick=\"ReturnImg('$reurl');\" $lstyle><img src='../../static/web/img/jpg.gif'>$file</a></td> | |||||
<td class='linerow'>$filesize KB</td> | <td class='linerow'>$filesize KB</td> | ||||
<td class='linerow'>$filetime</td> | <td class='linerow'>$filetime</td> | ||||
</tr>"; | </tr>"; | ||||
@@ -2,15 +2,14 @@ | |||||
/** | /** | ||||
* 图片选择 | * 图片选择 | ||||
* | * | ||||
* @version $Id: select_images_post.php 2022-07-01 tianya $ | |||||
* @version $Id: select_images_post.php 1 9:43 2010年7月8日Z tianya $ | |||||
* @package DedeBIZ.Dialog | * @package DedeBIZ.Dialog | ||||
* @copyright Copyright (c) 2022, DedeBIZ.COM | * @copyright Copyright (c) 2022, DedeBIZ.COM | ||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
helper('image'); | |||||
require_once(DEDEINC."/image.func.php"); | |||||
if (empty($activepath)) { | if (empty($activepath)) { | ||||
$activepath = ''; | $activepath = ''; | ||||
$activepath = str_replace('.', '', $activepath); | $activepath = str_replace('.', '', $activepath); | ||||
@@ -23,21 +22,21 @@ if (empty($imgfile)) { | |||||
$imgfile = ''; | $imgfile = ''; | ||||
} | } | ||||
if (!is_uploaded_file($imgfile)) { | if (!is_uploaded_file($imgfile)) { | ||||
ShowMsg(Lang("friendlink_err_imglogo_empty",array('file'=>$imgfile)), "-1"); | |||||
ShowMsg("您没有选择上传的文件".$imgfile, "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$CKEditorFuncNum = (isset($CKEditorFuncNum)) ? $CKEditorFuncNum : 1; | $CKEditorFuncNum = (isset($CKEditorFuncNum)) ? $CKEditorFuncNum : 1; | ||||
$imgfile_name = trim(preg_replace("#[ \r\n\t\*\%\\\/\?><\|\":]{1,}#", '', $imgfile_name)); | $imgfile_name = trim(preg_replace("#[ \r\n\t\*\%\\\/\?><\|\":]{1,}#", '', $imgfile_name)); | ||||
if (!preg_match("#\.(".$cfg_imgtype.")#i", $imgfile_name)) { | if (!preg_match("#\.(".$cfg_imgtype.")#i", $imgfile_name)) { | ||||
ShowMsg(Lang("dialog_err_imagetype"), "-1"); | |||||
ShowMsg("您所上传的图片类型不在许可列表,请修改系统对扩展名限定的配置", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$nowtme = time(); | $nowtme = time(); | ||||
$sparr = array("image/pjpeg", "image/jpeg", "image/gif", "image/png", "image/xpng", "image/wbmp", "image/webp"); | $sparr = array("image/pjpeg", "image/jpeg", "image/gif", "image/png", "image/xpng", "image/wbmp", "image/webp"); | ||||
$imgfile_type = strtolower(trim($imgfile_type)); | $imgfile_type = strtolower(trim($imgfile_type)); | ||||
if (!in_array($imgfile_type, $sparr)) { | if (!in_array($imgfile_type, $sparr)) { | ||||
ShowMsg(Lang("dialog_err_imageformat"), "-1"); | |||||
ShowMsg("上传的图片格式错误,请使用JPEG、GIF、PNG、WBMP格式的其中一种", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$mdir = MyDate($cfg_addon_savetype, $nowtme); | $mdir = MyDate($cfg_addon_savetype, $nowtme); | ||||
@@ -45,7 +44,7 @@ if (!is_dir($cfg_basedir.$activepath."/$mdir")) { | |||||
MkdirAll($cfg_basedir.$activepath."/$mdir", $cfg_dir_purview); | MkdirAll($cfg_basedir.$activepath."/$mdir", $cfg_dir_purview); | ||||
CloseFtp(); | CloseFtp(); | ||||
} | } | ||||
$filename_name = $cUserLogin->getUserID().'-'.dd2char(MyDate("ymdHis", $nowtme).mt_rand(100, 999)); | |||||
$filename_name = $cuserLogin->getUserID().'-'.dd2char(MyDate("ymdHis", $nowtme).mt_rand(100, 999)); | |||||
$filename = $mdir.'/'.$filename_name; | $filename = $mdir.'/'.$filename_name; | ||||
$fs = explode('.', $imgfile_name); | $fs = explode('.', $imgfile_name); | ||||
$filename = $filename.'.'.$fs[count($fs) - 1]; | $filename = $filename.'.'.$fs[count($fs) - 1]; | ||||
@@ -53,14 +52,14 @@ $filename_name = $filename_name.'.'.$fs[count($fs) - 1]; | |||||
$fullfilename = $cfg_basedir.$activepath."/".$filename; | $fullfilename = $cfg_basedir.$activepath."/".$filename; | ||||
$mime = get_mime_type($imgfile); | $mime = get_mime_type($imgfile); | ||||
if (preg_match("#^unknow#", $mime)) { | if (preg_match("#^unknow#", $mime)) { | ||||
ShowMsg(Lang("media_no_fileinfo"), -1); | |||||
ShowMsg("系统不支持fileinfo组件,建议php.ini中开启", -1); | |||||
exit; | exit; | ||||
} | } | ||||
if (!preg_match("#^(image|video|audio|application)#i", $mime)) { | if (!preg_match("#^(image|video|audio|application)#i", $mime)) { | ||||
ShowMsg(Lang("media_only_media"), -1); | |||||
ShowMsg("仅支持媒体文件及应用程序上传", -1); | |||||
exit; | exit; | ||||
} | } | ||||
move_uploaded_file($imgfile, $fullfilename) or die(Lang('media_err_upload',array('filename'=>$fullfilename))); | |||||
move_uploaded_file($imgfile, $fullfilename) or die("上传文件到 $fullfilename 失败"); | |||||
@unlink($imgfile); | @unlink($imgfile); | ||||
if (empty($resize)) { | if (empty($resize)) { | ||||
$resize = 0; | $resize = 0; | ||||
@@ -81,10 +80,10 @@ $sizes = getimagesize($fullfilename, $info); | |||||
$imgwidthValue = $sizes[0]; | $imgwidthValue = $sizes[0]; | ||||
$imgheightValue = $sizes[1]; | $imgheightValue = $sizes[1]; | ||||
$imgsize = filesize($fullfilename); | $imgsize = filesize($fullfilename); | ||||
$inquery = "INSERT INTO `#@__uploads`(arcid,title,url,mediatype,width,height,playtime,filesize,uptime,mid) VALUES ('0','$filename','".$activepath."/".$filename."','1','$imgwidthValue','$imgheightValue','0','{$imgsize}','{$nowtme}','".$cUserLogin->getUserID()."');"; | |||||
$inquery = "INSERT INTO `#@__uploads`(arcid,title,url,mediatype,width,height,playtime,filesize,uptime,mid) VALUES ('0','$filename','".$activepath."/".$filename."','1','$imgwidthValue','$imgheightValue','0','{$imgsize}','{$nowtme}','".$cuserLogin->getUserID()."'); "; | |||||
$dsql->ExecuteNoneQuery($inquery); | $dsql->ExecuteNoneQuery($inquery); | ||||
$fid = $dsql->GetLastID(); | $fid = $dsql->GetLastID(); | ||||
UserLogin::AddMyAddon($fid, $activepath.'/'.$filename); | |||||
AddMyAddon($fid, $activepath.'/'.$filename); | |||||
$CKUpload = isset($CKUpload) ? $CKUpload : FALSE; | $CKUpload = isset($CKUpload) ? $CKUpload : FALSE; | ||||
if ($GLOBALS['cfg_html_editor'] == 'ckeditor' && $CKUpload) { | if ($GLOBALS['cfg_html_editor'] == 'ckeditor' && $CKUpload) { | ||||
$fileurl = $activepath.'/'.$filename; | $fileurl = $activepath.'/'.$filename; | ||||
@@ -93,9 +92,9 @@ if ($GLOBALS['cfg_html_editor'] == 'ckeditor' && $CKUpload) { | |||||
exit; | exit; | ||||
} | } | ||||
if (!empty($noeditor)) { | if (!empty($noeditor)) { | ||||
ShowMsg(Lang("dialog_success_uploadimage"), "select_images.php?imgstick=$imgstick&comeback=".urlencode($filename_name)."&v=$v&f=$f&CKEditorFuncNum=$CKEditorFuncNum&noeditor=yes&activepath=".urlencode($activepath)."/$mdir&d=".time()); | |||||
ShowMsg("成功上传一幅图片", "select_images.php?imgstick=$imgstick&comeback=".urlencode($filename_name)."&v=$v&f=$f&CKEditorFuncNum=$CKEditorFuncNum&noeditor=yes&activepath=".urlencode($activepath)."/$mdir&d=".time()); | |||||
} else { | } else { | ||||
ShowMsg(Lang("dialog_success_uploadimage"), "select_images.php?imgstick=$imgstick&comeback=".urlencode($filename_name)."&v=$v&f=$f&CKEditorFuncNum=$CKEditorFuncNum&activepath=".urlencode($activepath)."/$mdir&d=".time()); | |||||
ShowMsg("成功上传一幅图片", "select_images.php?imgstick=$imgstick&comeback=".urlencode($filename_name)."&v=$v&f=$f&CKEditorFuncNum=$CKEditorFuncNum&activepath=".urlencode($activepath)."/$mdir&d=".time()); | |||||
} | } | ||||
exit(); | exit(); | ||||
?> | ?> |
@@ -2,7 +2,7 @@ | |||||
/** | /** | ||||
* 多媒体选择 | * 多媒体选择 | ||||
* | * | ||||
* @version $Id: select_media.php 2022-07-01 tianya $ | |||||
* @version $Id: select_media.php 1 9:43 2010年7月8日Z tianya $ | |||||
* @package DedeBIZ.Dialog | * @package DedeBIZ.Dialog | ||||
* @copyright Copyright (c) 2022, DedeBIZ.COM | * @copyright Copyright (c) 2022, DedeBIZ.COM | ||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
@@ -43,15 +43,16 @@ if (!empty($noeditor)) { | |||||
<!DOCTYPE html> | <!DOCTYPE html> | ||||
<html> | <html> | ||||
<head> | <head> | ||||
<meta charset="utf-8"> | |||||
<meta charset="<?php echo $cfg_soft_lang;?>"> | |||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> | <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> | ||||
<title><?php echo Lang('dialog_media_select');?></title> | |||||
<title>选择多媒体</title> | |||||
<link rel="stylesheet" href="../../static/web/css/bootstrap.min.css"> | <link rel="stylesheet" href="../../static/web/css/bootstrap.min.css"> | ||||
<link rel="stylesheet" href="../../static/web/font/css/font-awesome.min.css"> | <link rel="stylesheet" href="../../static/web/font/css/font-awesome.min.css"> | ||||
<link rel="stylesheet" href="../../static/web/css/admin.min.css"> | |||||
<link rel="stylesheet" href="../../static/web/css/admin.css"> | |||||
<style> | <style> | ||||
html{background:#f8f8f8} | html{background:#f8f8f8} | ||||
.bg{margin:10px;border-radius:.2rem;box-shadow:0 .125rem .25rem rgba(0,0,0,.075)} | |||||
.bg{margin:10px;border-radius:.2rem;box-shadow:0 1px 2px 0 rgba(0,0,0,.05)} | |||||
.linerow{border-bottom:1px solid #eee!important} | |||||
</style> | </style> | ||||
</head> | </head> | ||||
<body class="bg"> | <body class="bg"> | ||||
@@ -78,15 +79,15 @@ html{background:#f8f8f8} | |||||
<input type="hidden" name="f" value="<?php echo $f ?>"> | <input type="hidden" name="f" value="<?php echo $f ?>"> | ||||
<input type="hidden" name="job" value="upload"> | <input type="hidden" name="job" value="upload"> | ||||
<input type="hidden" name="CKEditorFuncNum" value="<?php echo isset($CKEditorFuncNum) ? $CKEditorFuncNum : 1;?>"> | <input type="hidden" name="CKEditorFuncNum" value="<?php echo isset($CKEditorFuncNum) ? $CKEditorFuncNum : 1;?>"> | ||||
上传:<input type="file" name="uploadfile" style="width:50%;border:0"> | |||||
<button type="submit" name="sb1" class="btn btn-success btn-sm"><?php echo Lang('upload');?></button> | |||||
上传:<input type="file" name="uploadfile" style="width:50%;border:none"> | |||||
<button type="submit" name="sb1" class="btn btn-success btn-sm">上传</button> | |||||
</form> | </form> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td width="50%" align="center" class="linerow"><?php echo Lang('dialog_media_name_select');?></td> | |||||
<td width="25%" align="center" class="linerow"><?php echo Lang('filesize');?></td> | |||||
<td width="25%" align="center" class="linerow"><?php echo Lang('edit_time');?></td> | |||||
<td width="55%" align="center" class="linerow">点击名称选择文件</td> | |||||
<td width="15%" align="center" class="linerow">文件大小</td> | |||||
<td width="30%" align="center" class="linerow">最后修改时间</td> | |||||
</tr> | </tr> | ||||
<?php | <?php | ||||
$dh = scandir($inpath); | $dh = scandir($inpath); | ||||
@@ -99,10 +100,10 @@ html{background:#f8f8f8} | |||||
$filesize = $filesize / 1024; | $filesize = $filesize / 1024; | ||||
if ($filesize != "") | if ($filesize != "") | ||||
if ($filesize < 0.1) { | if ($filesize < 0.1) { | ||||
@list($ty1, $ty2) = explode("\.", $filesize); | |||||
@list($ty1, $ty2) = split("\.", $filesize); | |||||
$filesize = $ty1.".".substr($ty2, 0, 2); | $filesize = $ty1.".".substr($ty2, 0, 2); | ||||
} else { | } else { | ||||
@list($ty1, $ty2) = explode("\.", $filesize); | |||||
@list($ty1, $ty2) = split("\.", $filesize); | |||||
$filesize = $ty1.".".substr($ty2, 0, 1); | $filesize = $ty1.".".substr($ty2, 0, 1); | ||||
} | } | ||||
$filetime = filemtime("$inpath/$file"); | $filetime = filemtime("$inpath/$file"); | ||||
@@ -114,19 +115,31 @@ html{background:#f8f8f8} | |||||
if ($activepath == "") continue; | if ($activepath == "") continue; | ||||
$tmp = preg_replace("#[\/][^\/]*$#i", "", $activepath); | $tmp = preg_replace("#[\/][^\/]*$#i", "", $activepath); | ||||
$line = "<tr> | $line = "<tr> | ||||
<td class='linerow'><a href='select_media.php?f=$f&activepath=".urlencode($tmp).$addparm."'><svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' class='bi bi-folder-symlink' viewBox='0 0 18 18'><path d='m11.798 8.271-3.182 1.97c-.27.166-.616-.036-.616-.372V9.1s-2.571-.3-4 2.4c.571-4.8 3.143-4.8 4-4.8v-.769c0-.336.346-.538.616-.371l3.182 1.969c.27.166.27.576 0 .742z'/><path d='m.5 3 .04.87a1.99 1.99 0 0 0-.342 1.311l.637 7A2 2 0 0 0 2.826 14h10.348a2 2 0 0 0 1.991-1.819l.637-7A2 2 0 0 0 13.81 3H9.828a2 2 0 0 1-1.414-.586l-.828-.828A2 2 0 0 0 6.172 1H2.5a2 2 0 0 0-2 2zm.694 2.09A1 1 0 0 1 2.19 4h11.62a1 1 0 0 1 .996 1.09l-.636 7a1 1 0 0 1-.996.91H2.826a1 1 0 0 1-.995-.91l-.637-7zM6.172 2a1 1 0 0 1 .707.293L7.586 3H2.19c-.24 0-.47.042-.683.12L1.5 2.98a1 1 0 0 1 1-.98h3.672z'/></svg>".Lang('parent_directory')."</a></td> | |||||
<td colspan='2' class='linerow'>".Lang('current_directory').":$activepath</td> | |||||
<td class='linerow'><a href='select_media.php?f=$f&activepath=".urlencode($tmp).$addparm."'><img src='../../static/web/img/dir2.gif'>上级目录</a></td> | |||||
<td colspan='2' class='linerow'>当前目录:$activepath</td> | |||||
</tr>"; | </tr>"; | ||||
echo $line; | echo $line; | ||||
} else if (is_dir("$inpath/$file")) { | } else if (is_dir("$inpath/$file")) { | ||||
if (preg_match("#^_(.*)$#i", $file)) continue; | if (preg_match("#^_(.*)$#i", $file)) continue; | ||||
if (preg_match("#^\.(.*)$#i", $file)) continue; | if (preg_match("#^\.(.*)$#i", $file)) continue; | ||||
$line = "<tr> | $line = "<tr> | ||||
<td class='linerow'><a href=select_media.php?f=$f&activepath=".urlencode("$activepath/$file").$addparm."><svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' class='bi bi-folder' viewBox='0 0 18 18'><path d='M.54 3.87.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3h3.982a2 2 0 0 1 1.992 2.181l-.637 7A2 2 0 0 1 13.174 14H2.826a2 2 0 0 1-1.991-1.819l-.637-7a1.99 1.99 0 0 1 .342-1.31zM2.19 4a1 1 0 0 0-.996 1.09l.637 7a1 1 0 0 0 .995.91h10.348a1 1 0 0 0 .995-.91l.637-7A1 1 0 0 0 13.81 4H2.19zm4.69-1.707A1 1 0 0 0 6.172 2H2.5a1 1 0 0 0-1 .981l.006.139C1.72 3.042 1.95 3 2.19 3h5.396l-.707-.707z'/></svg>$file</a></td> | |||||
<td class='linerow'><a href=select_media.php?f=$f&activepath=".urlencode("$activepath/$file").$addparm."><img src='../../static/web/img/dir.gif'>$file</a></td> | |||||
<td class='linerow'></td> | <td class='linerow'></td> | ||||
<td class='linerow'></td> | <td class='linerow'></td> | ||||
</tr>"; | </tr>"; | ||||
echo "$line"; | echo "$line"; | ||||
} else if (preg_match("#\.(swf|fly|fla|flv)#i", $file)) { | |||||
$reurl = "$activeurl/$file"; | |||||
$reurl = preg_replace("#^\.\.#", "", $reurl); | |||||
$reurl = $reurl; | |||||
if ($file == $comeback) $lstyle = " class='text-danger' "; | |||||
else $lstyle = ""; | |||||
$line = "<tr> | |||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\"><img src='../../static/web/img/flash.gif'>$file</a></td> | |||||
<td class='linerow'>$filesize KB</td> | |||||
<td align='center' class='linerow'>$filetime</td> | |||||
</tr>"; | |||||
echo "$line"; | |||||
} else if (preg_match("#\.(wmv|avi)#i", $file)) { | } else if (preg_match("#\.(wmv|avi)#i", $file)) { | ||||
$reurl = "$activeurl/$file"; | $reurl = "$activeurl/$file"; | ||||
$reurl = preg_replace("#^\.\.#", "", $reurl); | $reurl = preg_replace("#^\.\.#", "", $reurl); | ||||
@@ -134,7 +147,7 @@ html{background:#f8f8f8} | |||||
if ($file == $comeback) $lstyle = " class='text-danger' "; | if ($file == $comeback) $lstyle = " class='text-danger' "; | ||||
else $lstyle = ""; | else $lstyle = ""; | ||||
$line = "<tr> | $line = "<tr> | ||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\"><svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' class='bi bi-file-earmark-play' viewBox='0 0 18 18'><path d='M6 6.883v4.234a.5.5 0 0 0 .757.429l3.528-2.117a.5.5 0 0 0 0-.858L6.757 6.454a.5.5 0 0 0-.757.43z'/><path d='M14 14V4.5L9.5 0H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2zM9.5 3A1.5 1.5 0 0 0 11 4.5h2V14a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1h5.5v2z'/></svg>$file</a></td> | |||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\"><img src='../../static/web/img/wmv.gif'>$file</a></td> | |||||
<td class='linerow'>$filesize KB</td> | <td class='linerow'>$filesize KB</td> | ||||
<td class='linerow' align='center'>$filetime</td> | <td class='linerow' align='center'>$filetime</td> | ||||
</tr>"; | </tr>"; | ||||
@@ -146,7 +159,7 @@ html{background:#f8f8f8} | |||||
if ($file == $comeback) $lstyle = " class='text-danger' "; | if ($file == $comeback) $lstyle = " class='text-danger' "; | ||||
else $lstyle = ""; | else $lstyle = ""; | ||||
$line = "<tr> | $line = "<tr> | ||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\"><svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' class='bi bi-file-music' viewBox='0 0 18 18'><path d='M10.304 3.13a1 1 0 0 1 1.196.98v1.8l-2.5.5v5.09c0 .495-.301.883-.662 1.123C7.974 12.866 7.499 13 7 13c-.5 0-.974-.134-1.338-.377-.36-.24-.662-.628-.662-1.123s.301-.883.662-1.123C6.026 10.134 6.501 10 7 10c.356 0 .7.068 1 .196V4.41a1 1 0 0 1 .804-.98l1.5-.3z'/><path d='M4 0a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V2a2 2 0 0 0-2-2H4zm0 1h8a1 1 0 0 1 1 1v12a1 1 0 0 1-1 1H4a1 1 0 0 1-1-1V2a1 1 0 0 1 1-1z'/></svg>$file</a></td> | |||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\"><img src='../../static/web/img/rm.gif'>$file</a></td> | |||||
<td class='linerow'>$filesize KB</td> | <td class='linerow'>$filesize KB</td> | ||||
<td class='linerow' align='center'>$filetime</td> | <td class='linerow' align='center'>$filetime</td> | ||||
</tr>"; | </tr>"; | ||||
@@ -158,8 +171,7 @@ html{background:#f8f8f8} | |||||
if ($file == $comeback) $lstyle = " class='text-danger' "; | if ($file == $comeback) $lstyle = " class='text-danger' "; | ||||
else $lstyle = ""; | else $lstyle = ""; | ||||
$line = "<tr> | $line = "<tr> | ||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\"><svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' class='bi bi-filetype-mp3' viewBox='0 0 18 18'> | |||||
<path fill-rule='evenodd' d='M14 4.5V14a2 2 0 0 1-2 2v-1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5Zm-4.911 9.67h-.443v-.609h.422a.688.688 0 0 0 .322-.073.558.558 0 0 0 .22-.2.505.505 0 0 0 .076-.284.49.49 0 0 0-.176-.392.652.652 0 0 0-.442-.15.74.74 0 0 0-.252.041.625.625 0 0 0-.193.112.496.496 0 0 0-.179.349H7.71c.006-.157.04-.302.102-.437.063-.135.153-.252.27-.352.117-.101.26-.18.428-.237.17-.057.364-.086.583-.088.279-.002.52.042.723.132.203.09.36.214.472.372a.91.91 0 0 1 .173.539.833.833 0 0 1-.12.478.96.96 0 0 1-.619.439v.041a1.008 1.008 0 0 1 .718.434.909.909 0 0 1 .144.521c.002.19-.037.359-.117.507a1.104 1.104 0 0 1-.329.378c-.14.101-.302.18-.486.234-.182.053-.376.08-.583.08-.3 0-.558-.051-.77-.153a1.206 1.206 0 0 1-.487-.41 1.094 1.094 0 0 1-.178-.563h.726a.457.457 0 0 0 .106.258.664.664 0 0 0 .249.179.98.98 0 0 0 .357.067.903.903 0 0 0 .384-.076.598.598 0 0 0 .252-.217.56.56 0 0 0 .088-.319.556.556 0 0 0-.334-.522.81.81 0 0 0-.372-.079ZM.706 15.925v-2.66h.038l.952 2.16h.516l.946-2.16h.038v2.66h.715v-3.999h-.8l-1.14 2.596h-.026l-1.14-2.596H0v4h.706Zm5.458-3.999h-1.6v4h.792v-1.342h.803c.287 0 .53-.058.732-.173.203-.118.357-.276.463-.475a1.42 1.42 0 0 0 .161-.677c0-.25-.053-.475-.158-.677a1.175 1.175 0 0 0-.46-.477 1.4 1.4 0 0 0-.733-.179Zm.545 1.333a.795.795 0 0 1-.085.381.574.574 0 0 1-.237.24.793.793 0 0 1-.375.082h-.66v-1.406h.66c.219 0 .39.06.513.182.123.12.184.295.184.521Z'/></svg>$file</a></td> | |||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\"><img src='../../static/web/img/mp3.gif'>$file</a></td> | |||||
<td class='linerow'>$filesize KB</td> | <td class='linerow'>$filesize KB</td> | ||||
<td class='linerow' align='center'>$filetime</td> | <td class='linerow' align='center'>$filetime</td> | ||||
</tr>"; | </tr>"; | ||||
@@ -2,7 +2,7 @@ | |||||
/** | /** | ||||
* 多媒体发送 | * 多媒体发送 | ||||
* | * | ||||
* @version $Id: select_media_post.php 2022-07-01 tianya $ | |||||
* @version $Id: select_media_post.php 1 9:43 2010年7月8日Z tianya $ | |||||
* @package DedeBIZ.Dialog | * @package DedeBIZ.Dialog | ||||
* @copyright Copyright (c) 2022, DedeBIZ.COM | * @copyright Copyright (c) 2022, DedeBIZ.COM | ||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
@@ -12,7 +12,8 @@ include_once(dirname(__FILE__).'/config.php'); | |||||
$cfg_softtype = $cfg_mediatype."|mp4"; | $cfg_softtype = $cfg_mediatype."|mp4"; | ||||
$cfg_soft_dir = $cfg_other_medias; | $cfg_soft_dir = $cfg_other_medias; | ||||
$bkurl = 'select_media.php'; | $bkurl = 'select_media.php'; | ||||
$uploadmbtype = Lang("dialog_media_post"); | |||||
$uploadmbtype = "多媒体文件类型"; | |||||
if (empty($activepath)) { | if (empty($activepath)) { | ||||
$activepath = ''; | $activepath = ''; | ||||
$activepath = str_replace('.', '', $activepath); | $activepath = str_replace('.', '', $activepath); | ||||
@@ -1,13 +1,4 @@ | |||||
<?php | <?php | ||||
/** | |||||
* 多媒体选择 | |||||
* | |||||
* @version $Id: select_mimages.php 2022-07-01 tianya $ | |||||
* @package DedeBIZ.Dialog | |||||
* @copyright Copyright (c) 2022, DedeBIZ.COM | |||||
* @license https://www.dedebiz.com/license | |||||
* @link https://www.dedebiz.com | |||||
*/ | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
include(DEDEDATA.'/mark/inc_photowatermark_config.php'); | include(DEDEDATA.'/mark/inc_photowatermark_config.php'); | ||||
?> | ?> | ||||
@@ -20,7 +11,7 @@ include(DEDEDATA.'/mark/inc_photowatermark_config.php'); | |||||
<meta name="apple-mobile-web-app-capable" content="yes"> | <meta name="apple-mobile-web-app-capable" content="yes"> | ||||
<meta name="apple-mobile-web-app-status-bar-style" content="black"> | <meta name="apple-mobile-web-app-status-bar-style" content="black"> | ||||
<meta name="format-detection" content="telephone=no"> | <meta name="format-detection" content="telephone=no"> | ||||
<title><?php echo Lang('dialog_mimages');?></title> | |||||
<title>插入多图</title> | |||||
<style> | <style> | ||||
body{margin:0;line-height:1.5;font:12px Helvetica Neue,Helvetica,PingFang SC,Tahoma,Arial,sans-serif;color:#545b62;background:#fff} | body{margin:0;line-height:1.5;font:12px Helvetica Neue,Helvetica,PingFang SC,Tahoma,Arial,sans-serif;color:#545b62;background:#fff} | ||||
ul{margin:0;padding:0;list-style:none} | ul{margin:0;padding:0;list-style:none} | ||||
@@ -28,7 +19,7 @@ input[type=radio],input[type=checkbox]{margin:0;height:auto;box-shadow:none;outl | |||||
button+button{margin-left:10px} | button+button{margin-left:10px} | ||||
#wrap{padding:10px} | #wrap{padding:10px} | ||||
#topbar{padding:10px 0;border-bottom:1px solid #ccc;text-align:right} | #topbar{padding:10px 0;border-bottom:1px solid #ccc;text-align:right} | ||||
#topbar button{display:inline-block;border:0;padding:.25rem .5rem;line-height:1.5;font-size:12px;color:#fff;background:#1eb867;border-color:#1eb867;border-radius:.25rem;transition:all .6s;text-align:center} | |||||
#topbar button{display:inline-block;border:0;padding:.25rem .5rem;line-height:1.5;font-size:12px;color:#fff;background:#28a745;border-color:#28a745;border-radius:.25rem;transition:all .6s;text-align:center} | |||||
.topbar button+.topbar button{margin-left:10px} | .topbar button+.topbar button{margin-left:10px} | ||||
#topbar button:focus{background:#006829;border-color:#005b24;box-shadow:0 0 0 0.2rem rgba(38,159,86,.5);outline:none} | #topbar button:focus{background:#006829;border-color:#005b24;box-shadow:0 0 0 0.2rem rgba(38,159,86,.5);outline:none} | ||||
#file_list{display:grid;grid-gap:10px;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));padding-top:10px} | #file_list{display:grid;grid-gap:10px;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));padding-top:10px} | ||||
@@ -49,10 +40,10 @@ button+button{margin-left:10px} | |||||
<body> | <body> | ||||
<div id="wrap"> | <div id="wrap"> | ||||
<div id="topbar"> | <div id="topbar"> | ||||
<label><input type="checkbox" name="isWater" id="isWater" <?php if ($photo_markup == '1') echo "checked";?>> <?php echo Lang('dialog_mimages_iswatermark');?></label> | |||||
<button class="addfile"><?php echo Lang('dialog_mimages_addfile');?></button> | |||||
<button class="upall"><?php echo Lang('dialog_mimages_upload_all');?></button> | |||||
<button class="removeall"><?php echo Lang('dialog_mimages_clear');?></button> | |||||
<label><input type="checkbox" name="isWater" id="isWater" <?php if ($photo_markup == '1') echo "checked";?>> 是否水印</label> | |||||
<button class="addfile">添加文件</button> | |||||
<button class="upall">全部上传</button> | |||||
<button class="removeall">清空列表</button> | |||||
</div> | </div> | ||||
<ul id="file_list"></ul> | <ul id="file_list"></ul> | ||||
</div> | </div> | ||||
@@ -93,7 +84,7 @@ button+button{margin-left:10px} | |||||
for(let i=0;i<files_sum;i++){ | for(let i=0;i<files_sum;i++){ | ||||
let file = files[i]; | let file = files[i]; | ||||
if (!isFileImage(file)) { | if (!isFileImage(file)) { | ||||
alert("<?php echo Lang('dialog_mimages_err_imgformat');?>") | |||||
alert("选择非图片文件无法上传") | |||||
return; | return; | ||||
} | } | ||||
let blobUrl = window.URL.createObjectURL(file) | let blobUrl = window.URL.createObjectURL(file) | ||||
@@ -123,22 +114,22 @@ button+button{margin-left:10px} | |||||
document.addEventListener('drop', (e)=>{ | document.addEventListener('drop', (e)=>{ | ||||
e.stopPropagation(); | e.stopPropagation(); | ||||
e.preventDefault(); | e.preventDefault(); | ||||
if (!e.dataTransfer.files){return false;} | |||||
if(!e.dataTransfer.files){return false;} | |||||
var dropfiles = e.dataTransfer.files; | var dropfiles = e.dataTransfer.files; | ||||
if (!(dropfiles.length>0)){return false;} | |||||
if(!(dropfiles.length>0)){return false;} | |||||
var exts=axupimgs.axupimgs_filetype.replace(/(\s)+/g,'').toLowerCase().split(','); | var exts=axupimgs.axupimgs_filetype.replace(/(\s)+/g,'').toLowerCase().split(','); | ||||
var files=[]; | var files=[]; | ||||
for( let file of dropfiles ){ | for( let file of dropfiles ){ | ||||
ext = file.name.split('.'); | ext = file.name.split('.'); | ||||
ext = '.'+ext[ext.length-1]; | ext = '.'+ext[ext.length-1]; | ||||
for(let s of exts){ | for(let s of exts){ | ||||
if (s==ext){ | |||||
if(s==ext){ | |||||
files.push(file); | files.push(file); | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
} | } | ||||
if (files.length>0){ addList(files) } | |||||
if(files.length>0){ addList(files) } | |||||
}); | }); | ||||
//添加文件 | //添加文件 | ||||
document.querySelector('#topbar .addfile').addEventListener('click',()=>{ | document.querySelector('#topbar .addfile').addEventListener('click',()=>{ | ||||
@@ -156,9 +147,9 @@ button+button{margin-left:10px} | |||||
function upAllFiles(n){ | function upAllFiles(n){ | ||||
var len = axupimgs.res.length; | var len = axupimgs.res.length; | ||||
file_i = n; | file_i = n; | ||||
if (len == n){ | |||||
if(len == n){ | |||||
file_i=0; | file_i=0; | ||||
document.querySelector('#topbar .upall').innerText='<?php echo Lang("dialog_mimages_upload_all");?>'; | |||||
document.querySelector('#topbar .upall').innerText='全部上传'; | |||||
//返回 | //返回 | ||||
console.log(axupimgs.res); | console.log(axupimgs.res); | ||||
axupimgs.res.forEach((v,k)=>{ | axupimgs.res.forEach((v,k)=>{ | ||||
@@ -168,17 +159,17 @@ button+button{margin-left:10px} | |||||
window.close(); | window.close(); | ||||
return true; | return true; | ||||
} | } | ||||
if ( axupimgs.res[n].url!='' ){ | |||||
if( axupimgs.res[n].url!='' ){ | |||||
n++; | n++; | ||||
upAllFiles(n) | upAllFiles(n) | ||||
} else { | } else { | ||||
blobInfo.file=axupimgs.res[n].file; | blobInfo.file=axupimgs.res[n].file; | ||||
blobInfo.isWater = document.querySelector('#isWater').checked; | blobInfo.isWater = document.querySelector('#isWater').checked; | ||||
upload_handler(blobInfo,function(url){ | upload_handler(blobInfo,function(url){ | ||||
if (upload_base_path){ | |||||
if (upload_base_path.slice(-1)=='/' && url.substr(0,1)=='/' ){ | |||||
if(upload_base_path){ | |||||
if(upload_base_path.slice(-1)=='/' && url.substr(0,1)=='/' ){ | |||||
url = upload_base_path + url.slice(1); | url = upload_base_path + url.slice(1); | ||||
}else if (upload_base_path.slice(-1)!='/' && url.substr(0,1)!='/' ){ | |||||
}else if(upload_base_path.slice(-1)!='/' && url.substr(0,1)!='/' ){ | |||||
url = upload_base_path + '/' + url; | url = upload_base_path + '/' + url; | ||||
} else { | } else { | ||||
url = upload_base_path + url; | url = upload_base_path + url; | ||||
@@ -192,7 +183,7 @@ button+button{margin-left:10px} | |||||
n++ | n++ | ||||
upAllFiles(n); | upAllFiles(n); | ||||
},function(err){ | },function(err){ | ||||
document.querySelector('#topbar .upall').innerText='<?php echo Lang("dialog_mimages_upload_all");?>'; | |||||
document.querySelector('#topbar .upall').innerText='全部上传'; | |||||
document.querySelectorAll('#file_list li.up-now').forEach((el,i)=>{ | document.querySelectorAll('#file_list li.up-now').forEach((el,i)=>{ | ||||
el.setAttribute('class','up-no'); | el.setAttribute('class','up-no'); | ||||
}); | }); | ||||
@@ -201,8 +192,8 @@ button+button{margin-left:10px} | |||||
} | } | ||||
} | } | ||||
document.querySelector('#topbar .upall').addEventListener('click',(e)=>{ | document.querySelector('#topbar .upall').addEventListener('click',(e)=>{ | ||||
if (e.target.innerText!='全部上传'){return false;} | |||||
if (axupimgs.res.length>0){ | |||||
if(e.target.innerText!='全部上传'){return false;} | |||||
if(axupimgs.res.length>0){ | |||||
document.querySelectorAll('#file_list li.up-no').forEach((el,i)=>{ | document.querySelectorAll('#file_list li.up-no').forEach((el,i)=>{ | ||||
el.classList ? el.classList.add('up-now') : el.className+=' up-now'; | el.classList ? el.classList.add('up-now') : el.className+=' up-now'; | ||||
}); | }); | ||||
@@ -211,7 +202,7 @@ button+button{margin-left:10px} | |||||
} | } | ||||
}); | }); | ||||
var observ_flist = new MutationObserver( (muList,observe)=>{ | var observ_flist = new MutationObserver( (muList,observe)=>{ | ||||
if (muList[0].addedNodes.length>0){ | |||||
if(muList[0].addedNodes.length>0){ | |||||
muList[0].addedNodes.forEach((el)=>{ | muList[0].addedNodes.forEach((el)=>{ | ||||
el.querySelector('.remove').addEventListener('click',(e)=>{ | el.querySelector('.remove').addEventListener('click',(e)=>{ | ||||
var li = e.target.parentNode.parentNode; | var li = e.target.parentNode.parentNode; | ||||
@@ -2,7 +2,7 @@ | |||||
/** | /** | ||||
* 软件选择 | * 软件选择 | ||||
* | * | ||||
* @version $Id: select_soft.php 2022-07-01 tianya $ | |||||
* @version $Id: select_soft.php 1 9:43 2010年7月8日Z tianya $ | |||||
* @package DedeBIZ.Dialog | * @package DedeBIZ.Dialog | ||||
* @copyright Copyright (c) 2022, DedeBIZ.COM | * @copyright Copyright (c) 2022, DedeBIZ.COM | ||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
@@ -42,15 +42,16 @@ if (!empty($noeditor)) { | |||||
<!DOCTYPE html> | <!DOCTYPE html> | ||||
<html> | <html> | ||||
<head> | <head> | ||||
<meta charset="utf-8"> | |||||
<meta charset="<?php echo $cfg_soft_lang;?>"> | |||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> | <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> | ||||
<title><?php echo Lang('dialog_soft_select');?></title> | |||||
<title>选择软件</title> | |||||
<link rel="stylesheet" href="../../static/web/css/bootstrap.min.css"> | <link rel="stylesheet" href="../../static/web/css/bootstrap.min.css"> | ||||
<link rel="stylesheet" href="../../static/web/font/css/font-awesome.min.css"> | <link rel="stylesheet" href="../../static/web/font/css/font-awesome.min.css"> | ||||
<link rel="stylesheet" href="../../static/web/css/admin.min.css"> | |||||
<link rel="stylesheet" href="../../static/web/css/admin.css"> | |||||
<style> | <style> | ||||
html{background:#f8f8f8} | html{background:#f8f8f8} | ||||
.bg{margin:10px;border-radius:.2rem;box-shadow:0 .125rem .25rem rgba(0,0,0,.075)} | |||||
.bg{margin:10px;border-radius:.2rem;box-shadow:0 1px 2px 0 rgba(0,0,0,.05)} | |||||
.linerow{border-bottom:1px solid #eee!important} | |||||
</style> | </style> | ||||
</head> | </head> | ||||
<body class="bg"> | <body class="bg"> | ||||
@@ -64,7 +65,7 @@ html{background:#f8f8f8} | |||||
window.opener.CKEDITOR.tools.callFunction(funcNum, reimg); | window.opener.CKEDITOR.tools.callFunction(funcNum, reimg); | ||||
} | } | ||||
if (typeof window.opener.CKEDITOR.instances["<?php echo $f ?>"] !== "undefined") { | if (typeof window.opener.CKEDITOR.instances["<?php echo $f ?>"] !== "undefined") { | ||||
let addonHTML = `<a href='${reimg}' target='_blank'>附件:${reimg}</a>`; | |||||
let addonHTML = `<a href='${reimg}' target='_blank'><img src='<?php echo $cfg_cmspath ?>/static/web/img/addon.gif'>附件:${reimg}</a>`; | |||||
window.opener.CKEDITOR.instances["<?php echo $f ?>"].insertHtml(addonHTML); | window.opener.CKEDITOR.instances["<?php echo $f ?>"].insertHtml(addonHTML); | ||||
} | } | ||||
if (window.opener.document.<?php echo $f ?> != null) { | if (window.opener.document.<?php echo $f ?> != null) { | ||||
@@ -75,16 +76,16 @@ html{background:#f8f8f8} | |||||
window.close(); | window.close(); | ||||
} | } | ||||
</script> | </script> | ||||
<table width="100%" align="center" cellpadding="0" cellspacing="1" class="table table-borderless"> | |||||
<table width="100%" cellpadding="0" cellspacing="1" align="center" class="table table-borderless"> | |||||
<tr> | <tr> | ||||
<td colspan="3"> | <td colspan="3"> | ||||
<form action="select_soft_post.php" method="POST" enctype="multipart/form-data" name='myform'> | <form action="select_soft_post.php" method="POST" enctype="multipart/form-data" name='myform'> | ||||
<input type="hidden" name="activepath" value="<?php echo $activepath ?>"> | <input type="hidden" name="activepath" value="<?php echo $activepath ?>"> | ||||
<input type="hidden" name="f" value="<?php echo $f ?>"> | <input type="hidden" name="f" value="<?php echo $f ?>"> | ||||
<input type="hidden" name="job" value="upload"> | <input type="hidden" name="job" value="upload"> | ||||
<?php echo Lang('upload');?>:<input type="file" name="uploadfile" size="24" style="width:50%;border:0"> | |||||
<?php echo Lang('rename');?>:<input type="text" name="newname" style="width:160px"> | |||||
<button type="submit" name="sb1" class="btn btn-success btn-sm"><?php echo Lang('save');?></button> | |||||
上传:<input type="file" name="uploadfile" size="24" style="width:50%;border:none"> | |||||
改名:<input type="text" name="newname" style="width:160px"> | |||||
<button type="submit" name="sb1" class="btn btn-success btn-sm">保存</button> | |||||
</form> | </form> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
@@ -92,9 +93,9 @@ html{background:#f8f8f8} | |||||
<td colspan="3"> | <td colspan="3"> | ||||
<table width="100%" cellspacing="0" cellpadding="2"> | <table width="100%" cellspacing="0" cellpadding="2"> | ||||
<tr> | <tr> | ||||
<td width="50%" class="linerow"><?php echo Lang('dialog_soft_select');?></td> | |||||
<td width="25%" class="linerow"><?php echo Lang('filesize');?></td> | |||||
<td width="25%" class="linerow"><?php echo Lang('edit_time');?></td> | |||||
<td width="45%" class="linerow">选择文件</td> | |||||
<td width="25%" class="linerow">文件大小</td> | |||||
<td width="30%" class="linerow">修改时间</td> | |||||
</tr> | </tr> | ||||
<?php | <?php | ||||
$dh = scandir($inpath); | $dh = scandir($inpath); | ||||
@@ -106,10 +107,10 @@ html{background:#f8f8f8} | |||||
$filesize = $filesize / 1024; | $filesize = $filesize / 1024; | ||||
if ($filesize != "") | if ($filesize != "") | ||||
if ($filesize < 0.1) { | if ($filesize < 0.1) { | ||||
@list($ty1, $ty2) = explode("\.", $filesize); | |||||
@list($ty1, $ty2) = split("\.", $filesize); | |||||
$filesize = $ty1.".".substr($ty2, 0, 2); | $filesize = $ty1.".".substr($ty2, 0, 2); | ||||
} else { | } else { | ||||
@list($ty1, $ty2) = explode("\.", $filesize); | |||||
@list($ty1, $ty2) = split("\.", $filesize); | |||||
$filesize = $ty1.".".substr($ty2, 0, 1); | $filesize = $ty1.".".substr($ty2, 0, 1); | ||||
} | } | ||||
$filetime = filemtime("$inpath/$file"); | $filetime = filemtime("$inpath/$file"); | ||||
@@ -121,15 +122,15 @@ html{background:#f8f8f8} | |||||
if ($activepath == "") continue; | if ($activepath == "") continue; | ||||
$tmp = preg_replace("#[\/][^\/]*$#i", "", $activepath); | $tmp = preg_replace("#[\/][^\/]*$#i", "", $activepath); | ||||
$line = "<tr> | $line = "<tr> | ||||
<td class='linerow'><a href='select_soft.php?f=$f&activepath=".urlencode($tmp).$addparm."'><svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' class='bi bi-folder-symlink' viewBox='0 0 18 18'><path d='m11.798 8.271-3.182 1.97c-.27.166-.616-.036-.616-.372V9.1s-2.571-.3-4 2.4c.571-4.8 3.143-4.8 4-4.8v-.769c0-.336.346-.538.616-.371l3.182 1.969c.27.166.27.576 0 .742z'/><path d='m.5 3 .04.87a1.99 1.99 0 0 0-.342 1.311l.637 7A2 2 0 0 0 2.826 14h10.348a2 2 0 0 0 1.991-1.819l.637-7A2 2 0 0 0 13.81 3H9.828a2 2 0 0 1-1.414-.586l-.828-.828A2 2 0 0 0 6.172 1H2.5a2 2 0 0 0-2 2zm.694 2.09A1 1 0 0 1 2.19 4h11.62a1 1 0 0 1 .996 1.09l-.636 7a1 1 0 0 1-.996.91H2.826a1 1 0 0 1-.995-.91l-.637-7zM6.172 2a1 1 0 0 1 .707.293L7.586 3H2.19c-.24 0-.47.042-.683.12L1.5 2.98a1 1 0 0 1 1-.98h3.672z'/></svg>".Lang('parent_directory')."</a></td> | |||||
<td colspan='2' class='linerow'>".Lang('current_directory').":$activepath</td> | |||||
<td class='linerow'><a href='select_soft.php?f=$f&activepath=".urlencode($tmp).$addparm."'><img src='../../static/web/img/dir2.gif'>上级目录</a></td> | |||||
<td colspan='2' class='linerow'>当前目录:$activepath</td> | |||||
</tr>\r\n"; | </tr>\r\n"; | ||||
echo $line; | echo $line; | ||||
} else if (is_dir("$inpath/$file")) { | } else if (is_dir("$inpath/$file")) { | ||||
if (preg_match("#^_(.*)$#i", $file)) continue; | if (preg_match("#^_(.*)$#i", $file)) continue; | ||||
if (preg_match("#^\.(.*)$#i", $file)) continue; | if (preg_match("#^\.(.*)$#i", $file)) continue; | ||||
$line = "<tr> | $line = "<tr> | ||||
<td class='linerow'><a href=select_soft.php?f=$f&activepath=".urlencode("$activepath/$file").$addparm."><svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' class='bi bi-folder' viewBox='0 0 18 18'><path d='M.54 3.87.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3h3.982a2 2 0 0 1 1.992 2.181l-.637 7A2 2 0 0 1 13.174 14H2.826a2 2 0 0 1-1.991-1.819l-.637-7a1.99 1.99 0 0 1 .342-1.31zM2.19 4a1 1 0 0 0-.996 1.09l.637 7a1 1 0 0 0 .995.91h10.348a1 1 0 0 0 .995-.91l.637-7A1 1 0 0 0 13.81 4H2.19zm4.69-1.707A1 1 0 0 0 6.172 2H2.5a1 1 0 0 0-1 .981l.006.139C1.72 3.042 1.95 3 2.19 3h5.396l-.707-.707z'/></svg>$file</a></td> | |||||
<td class='linerow'><a href=select_soft.php?f=$f&activepath=".urlencode("$activepath/$file").$addparm."><img src='../../static/web/img/dir.gif'>$file</a></td> | |||||
<td class='linerow'></td> | <td class='linerow'></td> | ||||
<td class='linerow'></td> | <td class='linerow'></td> | ||||
</tr>"; | </tr>"; | ||||
@@ -141,7 +142,7 @@ html{background:#f8f8f8} | |||||
$reurl = preg_replace("#^\.\.#", "", $reurl); | $reurl = preg_replace("#^\.\.#", "", $reurl); | ||||
$reurl = $reurl; | $reurl = $reurl; | ||||
$line = "<tr> | $line = "<tr> | ||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' class='bi bi-file-zip' viewBox='0 0 18 18'><path d='M6.5 7.5a1 1 0 0 1 1-1h1a1 1 0 0 1 1 1v.938l.4 1.599a1 1 0 0 1-.416 1.074l-.93.62a1 1 0 0 1-1.109 0l-.93-.62a1 1 0 0 1-.415-1.074l.4-1.599V7.5zm2 0h-1v.938a1 1 0 0 1-.03.243l-.4 1.598.93.62.93-.62-.4-1.598a1 1 0 0 1-.03-.243V7.5z'/><path d='M2 2a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V2zm5.5-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h8a1 1 0 0 0 1-1V2a1 1 0 0 0-1-1H9v1H8v1h1v1H8v1h1v1H7.5V5h-1V4h1V3h-1V2h1V1z'/></svg>$file</a></td> | |||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='../../static/web/img/zip.gif'>$file</a></td> | |||||
<td class='linerow'>$filesize KB</td> | <td class='linerow'>$filesize KB</td> | ||||
<td class='linerow'>$filetime</td> | <td class='linerow'>$filetime</td> | ||||
</tr>"; | </tr>"; | ||||
@@ -153,7 +154,7 @@ html{background:#f8f8f8} | |||||
$reurl = preg_replace("#^\.\.#", "", $reurl); | $reurl = preg_replace("#^\.\.#", "", $reurl); | ||||
$reurl = $reurl; | $reurl = $reurl; | ||||
$line = "<tr> | $line = "<tr> | ||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' class='bi bi-filetype-exe' viewBox='0 0 18 18'><path fill-rule='evenodd' d='M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM2.575 15.202H.785v-1.073H2.47v-.606H.785v-1.025h1.79v-.648H0v3.999h2.575v-.647ZM6.31 11.85h-.893l-.823 1.439h-.036l-.832-1.439h-.931l1.227 1.983-1.239 2.016h.861l.853-1.415h.035l.85 1.415h.908l-1.254-1.992L6.31 11.85Zm1.025 3.352h1.79v.647H6.548V11.85h2.576v.648h-1.79v1.025h1.684v.606H7.334v1.073Z'/></svg>$file</a></td> | |||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='../../static/web/img/exe.gif'>$file</a></td> | |||||
<td class='linerow'>$filesize KB</td> | <td class='linerow'>$filesize KB</td> | ||||
<td class='linerow'>$filetime</td> | <td class='linerow'>$filetime</td> | ||||
</tr>"; | </tr>"; | ||||
@@ -165,7 +166,7 @@ html{background:#f8f8f8} | |||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td colspan="3"><?php echo Lang('dialog_soft_select_tip');?></td> | |||||
<td colspan="3">点击选择的文件,红色字样的为刚上传的文件</td> | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
</body> | </body> |
@@ -2,25 +2,24 @@ | |||||
/** | /** | ||||
* 软件发送 | * 软件发送 | ||||
* | * | ||||
* @version $Id: select_soft_post.php 2022-07-01 tianya $ | |||||
* @version $Id: select_soft_post.php 1 9:43 2010年7月8日Z tianya $ | |||||
* @package DedeBIZ.Dialog | * @package DedeBIZ.Dialog | ||||
* @copyright Copyright (c) 2022, DedeBIZ.COM | * @copyright Copyright (c) 2022, DedeBIZ.COM | ||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
if (!isset($cfg_basedir)) { | if (!isset($cfg_basedir)) { | ||||
include_once(dirname(__FILE__).'/config.php'); | include_once(dirname(__FILE__).'/config.php'); | ||||
} | } | ||||
if (empty($uploadfile)) $uploadfile = ''; | if (empty($uploadfile)) $uploadfile = ''; | ||||
if (empty($uploadmbtype)) $uploadmbtype = Lang('dialog_soft_type'); | |||||
if (empty($uploadmbtype)) $uploadmbtype = '软件类型'; | |||||
if (empty($bkurl)) $bkurl = 'select_soft.php'; | if (empty($bkurl)) $bkurl = 'select_soft.php'; | ||||
$CKEditorFuncNum = (isset($CKEditorFuncNum)) ? $CKEditorFuncNum : 1; | $CKEditorFuncNum = (isset($CKEditorFuncNum)) ? $CKEditorFuncNum : 1; | ||||
$newname = (empty($newname) ? '' : preg_replace("#[\\ \"\*\?\t\r\n<>':\/|]#", "", $newname)); | $newname = (empty($newname) ? '' : preg_replace("#[\\ \"\*\?\t\r\n<>':\/|]#", "", $newname)); | ||||
$uploadfile = isset($imgfile) && empty($uploadfile) ? $imgfile : $uploadfile; | $uploadfile = isset($imgfile) && empty($uploadfile) ? $imgfile : $uploadfile; | ||||
$uploadfile_name = isset($imgfile_name) && empty($uploadfile_name) ? $imgfile_name : $uploadfile_name; | $uploadfile_name = isset($imgfile_name) && empty($uploadfile_name) ? $imgfile_name : $uploadfile_name; | ||||
if (!is_uploaded_file($uploadfile)) { | if (!is_uploaded_file($uploadfile)) { | ||||
ShowMsg(Lang("dialog_soft_err_upload"), "-1"); | |||||
ShowMsg("您没有选择上传的文件或选择的文件大小超出限制", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
//软件类型所有支持的附件 | //软件类型所有支持的附件 | ||||
@@ -28,7 +27,7 @@ $cfg_softtype = $cfg_softtype; | |||||
$cfg_softtype = str_replace('||', '|', $cfg_softtype); | $cfg_softtype = str_replace('||', '|', $cfg_softtype); | ||||
$uploadfile_name = trim(preg_replace("#[ \r\n\t\*\%\\\/\?><\|\":]{1,}#", '', $uploadfile_name)); | $uploadfile_name = trim(preg_replace("#[ \r\n\t\*\%\\\/\?><\|\":]{1,}#", '', $uploadfile_name)); | ||||
if (!preg_match("#\.(".$cfg_softtype.")#i", $uploadfile_name)) { | if (!preg_match("#\.(".$cfg_softtype.")#i", $uploadfile_name)) { | ||||
ShowMsg(Lang('dialog_soft_err_filetype',array('type'=>$uploadmbtype)), "-1"); | |||||
ShowMsg("您所上传的{$uploadmbtype}不在许可列表,请修改系统对扩展名限定的配置", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$nowtme = time(); | $nowtme = time(); | ||||
@@ -40,21 +39,21 @@ if ($activepath == $cfg_soft_dir) { | |||||
CloseFtp(); | CloseFtp(); | ||||
} | } | ||||
} | } | ||||
//文件名前为手工指定,后者自动处理 | |||||
//文件名(前为手工指定, 后者自动处理) | |||||
if (!empty($newname)) { | if (!empty($newname)) { | ||||
$filename = $newname; | $filename = $newname; | ||||
if (!preg_match("#\.#", $filename)) $fs = explode('.', $uploadfile_name); | if (!preg_match("#\.#", $filename)) $fs = explode('.', $uploadfile_name); | ||||
else $fs = explode('.', $filename); | else $fs = explode('.', $filename); | ||||
if (preg_match("#".$cfg_not_allowall."#", $fs[count($fs) - 1])) { | if (preg_match("#".$cfg_not_allowall."#", $fs[count($fs) - 1])) { | ||||
ShowMsg(Lang("media_ext_forbidden"), 'javascript:;'); | |||||
ShowMsg("您指定的文件名被系统禁止", 'javascript:;'); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (!preg_match("#\.#", $filename)) $filename = $filename.'.'.$fs[count($fs) - 1]; | if (!preg_match("#\.#", $filename)) $filename = $filename.'.'.$fs[count($fs) - 1]; | ||||
} else { | } else { | ||||
$filename = $cUserLogin->getUserID().'-'.dd2char(MyDate('ymdHis', $nowtme)); | |||||
$filename = $cuserLogin->getUserID().'-'.dd2char(MyDate('ymdHis', $nowtme)); | |||||
$fs = explode('.', $uploadfile_name); | $fs = explode('.', $uploadfile_name); | ||||
if (preg_match("#".$cfg_not_allowall."#", $fs[count($fs) - 1])) { | if (preg_match("#".$cfg_not_allowall."#", $fs[count($fs) - 1])) { | ||||
ShowMsg(Lang("dialog_soft_err_notallow"), "-1"); | |||||
ShowMsg("您上传了某些可能存在不安全因素的文件,系统拒绝操作", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$filename = $filename.'.'.$fs[count($fs) - 1]; | $filename = $filename.'.'.$fs[count($fs) - 1]; | ||||
@@ -63,14 +62,14 @@ $fullfilename = $cfg_basedir.$activepath.'/'.$filename; | |||||
$fullfileurl = $activepath.'/'.$filename; | $fullfileurl = $activepath.'/'.$filename; | ||||
$mime = get_mime_type($uploadfile); | $mime = get_mime_type($uploadfile); | ||||
if (preg_match("#^unknow#", $mime)) { | if (preg_match("#^unknow#", $mime)) { | ||||
ShowMsg(Lang("media_no_fileinfo"), -1); | |||||
ShowMsg("系统不支持fileinfo组件,建议php.ini中开启", -1); | |||||
exit; | exit; | ||||
} | } | ||||
if (!preg_match("#^(image|video|audio|application)#i", $mime)) { | if (!preg_match("#^(image|video|audio|application)#i", $mime)) { | ||||
ShowMsg(Lang("media_only_media"), -1); | |||||
ShowMsg("仅支持媒体文件及应用程序上传", -1); | |||||
exit; | exit; | ||||
} | } | ||||
move_uploaded_file($uploadfile, $fullfilename) or die(Lang('media_err_upload',array('filename'=>$fullfilename))); | |||||
move_uploaded_file($uploadfile, $fullfilename) or die("上传文件到 $fullfilename 失败"); | |||||
@unlink($uploadfile); | @unlink($uploadfile); | ||||
if ($uploadfile_type == 'application/x-shockwave-flash') { | if ($uploadfile_type == 'application/x-shockwave-flash') { | ||||
$mediatype = 2; | $mediatype = 2; | ||||
@@ -81,10 +80,10 @@ if ($uploadfile_type == 'application/x-shockwave-flash') { | |||||
} else { | } else { | ||||
$mediatype = 4; | $mediatype = 4; | ||||
} | } | ||||
$inquery = "INSERT INTO `#@__uploads`(arcid,title,url,mediatype,width,height,playtime,filesize,uptime,mid) VALUES ('0','$filename','$fullfileurl','$mediatype','0','0','0','{$uploadfile_size}','{$nowtme}','".$cUserLogin->getUserID()."');"; | |||||
$inquery = "INSERT INTO `#@__uploads`(arcid,title,url,mediatype,width,height,playtime,filesize,uptime,mid) VALUES ('0','$filename','$fullfileurl','$mediatype','0','0','0','{$uploadfile_size}','{$nowtme}','".$cuserLogin->getUserID()."'); "; | |||||
$dsql->ExecuteNoneQuery($inquery); | $dsql->ExecuteNoneQuery($inquery); | ||||
$fid = $dsql->GetLastID(); | $fid = $dsql->GetLastID(); | ||||
UserLogin::AddMyAddon($fid, $fullfileurl); | |||||
AddMyAddon($fid, $fullfileurl); | |||||
if ($ck == 1) { | if ($ck == 1) { | ||||
$funcNum = isset($_GET['CKEditorFuncNum']) ? $_GET['CKEditorFuncNum'] : 1; | $funcNum = isset($_GET['CKEditorFuncNum']) ? $_GET['CKEditorFuncNum'] : 1; | ||||
$url = $fullfileurl; | $url = $fullfileurl; | ||||
@@ -95,7 +94,7 @@ if ($ck == 1) { | |||||
); | ); | ||||
echo json_encode($arr); | echo json_encode($arr); | ||||
} else { | } else { | ||||
ShowMsg(Lang("dialog_soft_success_upload"), $bkurl."?comeback=".urlencode($filename)."&f=$f&CKEditorFuncNum=$CKEditorFuncNum&activepath=".urlencode($activepath)."&d=".time()); | |||||
ShowMsg("成功上传文件", $bkurl."?comeback=".urlencode($filename)."&f=$f&CKEditorFuncNum=$CKEditorFuncNum&activepath=".urlencode($activepath)."&d=".time()); | |||||
exit(); | exit(); | ||||
} | } | ||||
?> | ?> |
@@ -2,7 +2,7 @@ | |||||
/** | /** | ||||
* 模板选择 | * 模板选择 | ||||
* | * | ||||
* @version $Id: select_templets.php 2022-07-01 tianya $ | |||||
* @version $Id: select_templets.php 1 9:43 2010年7月8日Z tianya $ | |||||
* @package DedeBIZ.Dialog | * @package DedeBIZ.Dialog | ||||
* @copyright Copyright (c) 2022, DedeBIZ.COM | * @copyright Copyright (c) 2022, DedeBIZ.COM | ||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
@@ -20,7 +20,7 @@ if (strlen($activepath) < strlen($templetdir)) { | |||||
$activepath = $templetdir; | $activepath = $templetdir; | ||||
} | } | ||||
$inpath = $cfg_basedir.$activepath; | $inpath = $cfg_basedir.$activepath; | ||||
$activeurl = $activepath; | |||||
$activeurl = '..'.$activepath; | |||||
if (!is_dir($inpath)) { | if (!is_dir($inpath)) { | ||||
die('No Exsits Path'); | die('No Exsits Path'); | ||||
} | } | ||||
@@ -34,15 +34,16 @@ if (empty($comeback)) { | |||||
<!DOCTYPE html> | <!DOCTYPE html> | ||||
<html> | <html> | ||||
<head> | <head> | ||||
<meta charset="utf-8"> | |||||
<meta charset="<?php echo $cfg_soft_lang;?>"> | |||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> | <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"> | ||||
<title><?php echo Lang('dialog_template_select');?></title> | |||||
<title>选择模板</title> | |||||
<link rel="stylesheet" href="../../static/web/css/bootstrap.min.css"> | <link rel="stylesheet" href="../../static/web/css/bootstrap.min.css"> | ||||
<link rel="stylesheet" href="../../static/web/font/css/font-awesome.min.css"> | <link rel="stylesheet" href="../../static/web/font/css/font-awesome.min.css"> | ||||
<link rel="stylesheet" href="../../static/web/css/admin.min.css"> | |||||
<link rel="stylesheet" href="../../static/web/css/admin.css"> | |||||
<style> | <style> | ||||
html{background:#f8f8f8} | html{background:#f8f8f8} | ||||
.bg{margin:10px;border-radius:.2rem;box-shadow:0 .125rem .25rem rgba(0,0,0,.075)} | |||||
.bg{margin:10px;border-radius:.2rem;box-shadow:0 1px 2px 0 rgba(0,0,0,.05)} | |||||
.linerow{border-bottom:1px solid #eee!important} | |||||
</style> | </style> | ||||
</head> | </head> | ||||
<body class="bg"> | <body class="bg"> | ||||
@@ -56,23 +57,23 @@ html{background:#f8f8f8} | |||||
window.close(); | window.close(); | ||||
} | } | ||||
</script> | </script> | ||||
<table width="100%" align="center" cellpadding="0" cellspacing="1" class="table table-borderless"> | |||||
<table width="100%" cellpadding="0" cellspacing="1" align="center" class="table table-borderless"> | |||||
<tr> | <tr> | ||||
<td colspan="3"> | <td colspan="3"> | ||||
<form action="select_templets_post.php" method="POST" enctype="multipart/form-data" name="myform"> | <form action="select_templets_post.php" method="POST" enctype="multipart/form-data" name="myform"> | ||||
<input type="hidden" name="activepath" value="<?php echo $activepath ?>"> | <input type="hidden" name="activepath" value="<?php echo $activepath ?>"> | ||||
<input type="hidden" name="f" value="<?php echo $f ?>"> | <input type="hidden" name="f" value="<?php echo $f ?>"> | ||||
<input type="hidden" name="job" value="upload"> | <input type="hidden" name="job" value="upload"> | ||||
<?php echo Lang('upload');?>:<input type="file" name="uploadfile" style="width:50%;border:0"> | |||||
<?php echo Lang('rename');?>:<input type="text" name="filename" style="width:160px"> | |||||
<button type="submit" name="sb1" class="btn btn-success btn-sm"><?php echo Lang('save');?></button> | |||||
上传:<input type="file" name="uploadfile" style="width:50%;border:none"> | |||||
改名:<input type="text" name="filename" style="width:160px"> | |||||
<button type="submit" name="sb1" class="btn btn-success btn-sm">保存</button> | |||||
</form> | </form> | ||||
</td> | </td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td width="50%" class="linerow"><?php echo Lang('dialog_template_select');?></td> | |||||
<td width="25%" class="linerow"><?php echo Lang('filesize');?></td> | |||||
<td width="25%" class="linerow"><?php echo Lang('edit_time');?></td> | |||||
<td width="50%" class="linerow">选择文件</td> | |||||
<td width="20%" class="linerow">文件大小</td> | |||||
<td width="30%" class="linerow">修改时间</td> | |||||
</tr> | </tr> | ||||
<?php | <?php | ||||
$dh = scandir($inpath); | $dh = scandir($inpath); | ||||
@@ -85,10 +86,10 @@ html{background:#f8f8f8} | |||||
$filesize = $filesize / 1024; | $filesize = $filesize / 1024; | ||||
if ($filesize != "") | if ($filesize != "") | ||||
if ($filesize < 0.1) { | if ($filesize < 0.1) { | ||||
@list($ty1, $ty2) = explode("\.", $filesize); | |||||
@list($ty1, $ty2) = split("\.", $filesize); | |||||
$filesize = $ty1.".".substr($ty2, 0, 2); | $filesize = $ty1.".".substr($ty2, 0, 2); | ||||
} else { | } else { | ||||
@list($ty1, $ty2) = explode("\.", $filesize); | |||||
@list($ty1, $ty2) = split("\.", $filesize); | |||||
$filesize = $ty1.".".substr($ty2, 0, 1); | $filesize = $ty1.".".substr($ty2, 0, 1); | ||||
} | } | ||||
$filetime = filemtime("$inpath/$file"); | $filetime = filemtime("$inpath/$file"); | ||||
@@ -100,15 +101,15 @@ html{background:#f8f8f8} | |||||
if ($activepath == "") continue; | if ($activepath == "") continue; | ||||
$tmp = preg_replace("#[\/][^\/]*$#", "", $activepath); | $tmp = preg_replace("#[\/][^\/]*$#", "", $activepath); | ||||
$line = "<tr> | $line = "<tr> | ||||
<td class='linerow'><a href='select_templets.php?f=$f&activepath=".urlencode($tmp)."'><svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' class='bi bi-folder-symlink' viewBox='0 0 18 18'><path d='m11.798 8.271-3.182 1.97c-.27.166-.616-.036-.616-.372V9.1s-2.571-.3-4 2.4c.571-4.8 3.143-4.8 4-4.8v-.769c0-.336.346-.538.616-.371l3.182 1.969c.27.166.27.576 0 .742z'/><path d='m.5 3 .04.87a1.99 1.99 0 0 0-.342 1.311l.637 7A2 2 0 0 0 2.826 14h10.348a2 2 0 0 0 1.991-1.819l.637-7A2 2 0 0 0 13.81 3H9.828a2 2 0 0 1-1.414-.586l-.828-.828A2 2 0 0 0 6.172 1H2.5a2 2 0 0 0-2 2zm.694 2.09A1 1 0 0 1 2.19 4h11.62a1 1 0 0 1 .996 1.09l-.636 7a1 1 0 0 1-.996.91H2.826a1 1 0 0 1-.995-.91l-.637-7zM6.172 2a1 1 0 0 1 .707.293L7.586 3H2.19c-.24 0-.47.042-.683.12L1.5 2.98a1 1 0 0 1 1-.98h3.672z'/></svg>".Lang('parent_directory')."</a></td> | |||||
<td colspan='2' class='linerow'>".Lang('current_directory').":$activepath</td> | |||||
<td class='linerow'><a href='select_templets.php?f=$f&activepath=".urlencode($tmp)."'><img src='../../static/web/img/dir2.gif'>上级目录</a></td> | |||||
<td colspan='2' class='linerow'>当前目录:$activepath</td> | |||||
</tr>\r\n"; | </tr>\r\n"; | ||||
echo $line; | echo $line; | ||||
} else if (is_dir("$inpath/$file")) { | } else if (is_dir("$inpath/$file")) { | ||||
if (preg_match("#^_(.*)$#i", $file)) continue; | if (preg_match("#^_(.*)$#i", $file)) continue; | ||||
if (preg_match("#^\.(.*)$#i", $file)) continue; | if (preg_match("#^\.(.*)$#i", $file)) continue; | ||||
$line = "<tr> | $line = "<tr> | ||||
<td class='linerow'><a href=select_templets.php?f=$f&activepath=".urlencode("$activepath/$file")."><svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' class='bi bi-folder' viewBox='0 0 18 18'><path d='M.54 3.87.5 3a2 2 0 0 1 2-2h3.672a2 2 0 0 1 1.414.586l.828.828A2 2 0 0 0 9.828 3h3.982a2 2 0 0 1 1.992 2.181l-.637 7A2 2 0 0 1 13.174 14H2.826a2 2 0 0 1-1.991-1.819l-.637-7a1.99 1.99 0 0 1 .342-1.31zM2.19 4a1 1 0 0 0-.996 1.09l.637 7a1 1 0 0 0 .995.91h10.348a1 1 0 0 0 .995-.91l.637-7A1 1 0 0 0 13.81 4H2.19zm4.69-1.707A1 1 0 0 0 6.172 2H2.5a1 1 0 0 0-1 .981l.006.139C1.72 3.042 1.95 3 2.19 3h5.396l-.707-.707z'/></svg>$file</a></td> | |||||
<td class='linerow'><a href=select_templets.php?f=$f&activepath=".urlencode("$activepath/$file")."><img src='../../static/web/img/dir.gif'>$file</a></td> | |||||
<td class='linerow'></td> | <td class='linerow'></td> | ||||
<td class='linerow'></td> | <td class='linerow'></td> | ||||
</tr>"; | </tr>"; | ||||
@@ -120,7 +121,7 @@ html{background:#f8f8f8} | |||||
$reurl = preg_replace("#\.\.#", "", $reurl); | $reurl = preg_replace("#\.\.#", "", $reurl); | ||||
$reurl = preg_replace("#".$templetdir."\/#", "", $reurl); | $reurl = preg_replace("#".$templetdir."\/#", "", $reurl); | ||||
$line = "<tr> | $line = "<tr> | ||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' class='bi bi-filetype-html' viewBox='0 0 18 18'><path fill-rule='evenodd' d='M14 4.5V11h-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5Zm-9.736 7.35v3.999h-.791v-1.714H1.79v1.714H1V11.85h.791v1.626h1.682V11.85h.79Zm2.251.662v3.337h-.794v-3.337H4.588v-.662h3.064v.662H6.515Zm2.176 3.337v-2.66h.038l.952 2.159h.516l.946-2.16h.038v2.661h.715V11.85h-.8l-1.14 2.596H9.93L8.79 11.85h-.805v3.999h.706Zm4.71-.674h1.696v.674H12.61V11.85h.79v3.325Z'/></svg>$file</a></td> | |||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='../../static/web/img/htm.gif'>$file</a></td> | |||||
<td class='linerow'>$filesize KB</td> | <td class='linerow'>$filesize KB</td> | ||||
<td class='linerow'>$filetime</td> | <td class='linerow'>$filetime</td> | ||||
</tr>"; | </tr>"; | ||||
@@ -132,7 +133,7 @@ html{background:#f8f8f8} | |||||
$reurl = preg_replace("#\.\.#", "", $reurl); | $reurl = preg_replace("#\.\.#", "", $reurl); | ||||
$reurl = preg_replace("#".$templetdir."/#", "", $reurl); | $reurl = preg_replace("#".$templetdir."/#", "", $reurl); | ||||
$line = "<tr> | $line = "<tr> | ||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' class='bi bi-filetype-css' viewBox='0 0 18 18'><path fill-rule='evenodd' d='M14 4.5V14a2 2 0 0 1-2 2h-1v-1h1a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM3.397 14.841a1.13 1.13 0 0 0 .401.823c.13.108.289.192.478.252.19.061.411.091.665.091.338 0 .624-.053.859-.158.236-.105.416-.252.539-.44.125-.189.187-.408.187-.656 0-.224-.045-.41-.134-.56a1.001 1.001 0 0 0-.375-.357 2.027 2.027 0 0 0-.566-.21l-.621-.144a.97.97 0 0 1-.404-.176.37.37 0 0 1-.144-.299c0-.156.062-.284.185-.384.125-.101.296-.152.512-.152.143 0 .266.023.37.068a.624.624 0 0 1 .246.181.56.56 0 0 1 .12.258h.75a1.092 1.092 0 0 0-.2-.566 1.21 1.21 0 0 0-.5-.41 1.813 1.813 0 0 0-.78-.152c-.293 0-.551.05-.776.15-.225.099-.4.24-.527.421-.127.182-.19.395-.19.639 0 .201.04.376.122.524.082.149.2.27.352.367.152.095.332.167.539.213l.618.144c.207.049.361.113.463.193a.387.387 0 0 1 .152.326.505.505 0 0 1-.085.29.559.559 0 0 1-.255.193c-.111.047-.249.07-.413.07-.117 0-.223-.013-.32-.04a.838.838 0 0 1-.248-.115.578.578 0 0 1-.255-.384h-.765ZM.806 13.693c0-.248.034-.46.102-.633a.868.868 0 0 1 .302-.399.814.814 0 0 1 .475-.137c.15 0 .283.032.398.097a.7.7 0 0 1 .272.26.85.85 0 0 1 .12.381h.765v-.072a1.33 1.33 0 0 0-.466-.964 1.441 1.441 0 0 0-.489-.272 1.838 1.838 0 0 0-.606-.097c-.356 0-.66.074-.911.223-.25.148-.44.359-.572.632-.13.274-.196.6-.196.979v.498c0 .379.064.704.193.976.131.271.322.48.572.626.25.145.554.217.914.217.293 0 .554-.055.785-.164.23-.11.414-.26.55-.454a1.27 1.27 0 0 0 .226-.674v-.076h-.764a.799.799 0 0 1-.118.363.7.7 0 0 1-.272.25.874.874 0 0 1-.401.087.845.845 0 0 1-.478-.132.833.833 0 0 1-.299-.392 1.699 1.699 0 0 1-.102-.627v-.495ZM6.78 15.29a1.176 1.176 0 0 1-.111-.449h.764a.578.578 0 0 0 .255.384c.07.049.154.087.25.114.095.028.201.041.319.041.164 0 .301-.023.413-.07a.559.559 0 0 0 .255-.193.507.507 0 0 0 .085-.29.387.387 0 0 0-.153-.326c-.101-.08-.256-.144-.463-.193l-.618-.143a1.72 1.72 0 0 1-.539-.214 1 1 0 0 1-.351-.367 1.068 1.068 0 0 1-.123-.524c0-.244.063-.457.19-.639.127-.181.303-.322.527-.422.225-.1.484-.149.777-.149.304 0 .564.05.779.152.217.102.384.239.5.41.12.17.187.359.2.566h-.75a.56.56 0 0 0-.12-.258.624.624 0 0 0-.246-.181.923.923 0 0 0-.37-.068c-.216 0-.387.05-.512.152a.472.472 0 0 0-.184.384c0 .121.047.22.143.3a.97.97 0 0 0 .404.175l.621.143c.217.05.406.12.566.211.16.09.285.21.375.358.09.148.135.335.135.56 0 .247-.063.466-.188.656a1.216 1.216 0 0 1-.539.439c-.234.105-.52.158-.858.158-.254 0-.476-.03-.665-.09a1.404 1.404 0 0 1-.478-.252 1.13 1.13 0 0 1-.29-.375Z'/></svg>$file</a></td> | |||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='../../static/web/img/css.gif'>$file</a></td> | |||||
<td class='linerow'>$filesize KB</td> | <td class='linerow'>$filesize KB</td> | ||||
<td class='linerow'>$filetime</td> | <td class='linerow'>$filetime</td> | ||||
</tr>"; | </tr>"; | ||||
@@ -144,7 +145,7 @@ html{background:#f8f8f8} | |||||
$reurl = preg_replace("#\.\.#", "", $reurl); | $reurl = preg_replace("#\.\.#", "", $reurl); | ||||
$reurl = preg_replace("#".$templetdir."\/#", "", $reurl); | $reurl = preg_replace("#".$templetdir."\/#", "", $reurl); | ||||
$line = "<tr> | $line = "<tr> | ||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' class='bi bi-filetype-js' viewBox='0 0 18 18'><path fill-rule='evenodd' d='M14 4.5V14a2 2 0 0 1-2 2H8v-1h4a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM3.186 15.29a1.176 1.176 0 0 1-.111-.449h.765a.578.578 0 0 0 .255.384c.07.049.153.087.249.114.095.028.202.041.319.041.164 0 .302-.023.413-.07a.559.559 0 0 0 .255-.193.507.507 0 0 0 .085-.29.387.387 0 0 0-.153-.326c-.101-.08-.255-.144-.462-.193l-.619-.143a1.72 1.72 0 0 1-.539-.214 1.001 1.001 0 0 1-.351-.367 1.068 1.068 0 0 1-.123-.524c0-.244.063-.457.19-.639.127-.181.303-.322.528-.422.224-.1.483-.149.776-.149.305 0 .564.05.78.152.216.102.383.239.5.41.12.17.186.359.2.566h-.75a.56.56 0 0 0-.12-.258.624.624 0 0 0-.247-.181.923.923 0 0 0-.369-.068c-.217 0-.388.05-.513.152a.472.472 0 0 0-.184.384c0 .121.048.22.143.3a.97.97 0 0 0 .405.175l.62.143c.218.05.406.12.566.211.16.09.285.21.375.358.09.148.135.335.135.56 0 .247-.063.466-.188.656a1.216 1.216 0 0 1-.539.439c-.234.105-.52.158-.858.158-.254 0-.476-.03-.665-.09a1.404 1.404 0 0 1-.478-.252 1.13 1.13 0 0 1-.29-.375Zm-3.104-.033A1.32 1.32 0 0 1 0 14.791h.765a.576.576 0 0 0 .073.27.499.499 0 0 0 .454.246c.19 0 .33-.055.422-.164.092-.11.138-.265.138-.466v-2.745h.79v2.725c0 .44-.119.774-.357 1.005-.236.23-.564.345-.984.345a1.59 1.59 0 0 1-.569-.094 1.145 1.145 0 0 1-.407-.266 1.14 1.14 0 0 1-.243-.39Z'/></svg>$file</a></td> | |||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='../../static/web/img/js.gif'>$file</a></td> | |||||
<td class='linerow'>$filesize KB</td> | <td class='linerow'>$filesize KB</td> | ||||
<td class='linerow'>$filetime</td> | <td class='linerow'>$filetime</td> | ||||
</tr>"; | </tr>"; | ||||
@@ -156,7 +157,7 @@ html{background:#f8f8f8} | |||||
$reurl = preg_replace("#\.\.#", "", $reurl); | $reurl = preg_replace("#\.\.#", "", $reurl); | ||||
$reurl = preg_replace("#".$templetdir."\/#", "", $reurl); | $reurl = preg_replace("#".$templetdir."\/#", "", $reurl); | ||||
$line = "<tr> | $line = "<tr> | ||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='$activeurl/$file' class='file-icon'>$file</a></td> | |||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='../../static/web/img/jpg.gif'>$file</a></td> | |||||
<td class='linerow'>$filesize KB</td> | <td class='linerow'>$filesize KB</td> | ||||
<td class='linerow'>$filetime</td> | <td class='linerow'>$filetime</td> | ||||
</tr>"; | </tr>"; | ||||
@@ -168,7 +169,7 @@ html{background:#f8f8f8} | |||||
$reurl = preg_replace("#\.\.#", "", $reurl); | $reurl = preg_replace("#\.\.#", "", $reurl); | ||||
$reurl = preg_replace("#".$templetdir."\/#", "", $reurl); | $reurl = preg_replace("#".$templetdir."\/#", "", $reurl); | ||||
$line = "<tr> | $line = "<tr> | ||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='$activeurl/$file' class='file-icon'>$file</a></td> | |||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='../../static/web/img/gif.gif'>$file</a></td> | |||||
<td class='linerow'>$filesize KB</td> | <td class='linerow'>$filesize KB</td> | ||||
<td class='linerow'>$filetime</td> | <td class='linerow'>$filetime</td> | ||||
</tr>"; | </tr>"; | ||||
@@ -180,7 +181,7 @@ html{background:#f8f8f8} | |||||
$reurl = preg_replace("#\.\.#", "", $reurl); | $reurl = preg_replace("#\.\.#", "", $reurl); | ||||
$reurl = preg_replace("#".$templetdir."\/#", "", $reurl); | $reurl = preg_replace("#".$templetdir."\/#", "", $reurl); | ||||
$line = "<tr> | $line = "<tr> | ||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><svg xmlns='http://www.w3.org/2000/svg' fill='currentColor' class='bi bi-filetype-txt' viewBox='0 0 18 18'><path fill-rule='evenodd' d='M14 4.5V14a2 2 0 0 1-2 2h-2v-1h2a1 1 0 0 0 1-1V4.5h-2A1.5 1.5 0 0 1 9.5 3V1H4a1 1 0 0 0-1 1v9H2V2a2 2 0 0 1 2-2h5.5L14 4.5ZM1.928 15.849v-3.337h1.136v-.662H0v.662h1.134v3.337h.794Zm4.689-3.999h-.894L4.9 13.289h-.035l-.832-1.439h-.932l1.228 1.983-1.24 2.016h.862l.853-1.415h.035l.85 1.415h.907l-1.253-1.992 1.274-2.007Zm1.93.662v3.337h-.794v-3.337H6.619v-.662h3.064v.662H8.546Z'/></svg>$file</a></td> | |||||
<td class='linerow'><a href=\"javascript:ReturnValue('$reurl');\" $lstyle><img src='../../static/web/img/txt.gif'>$file</a></td> | |||||
<td class='linerow'>$filesize KB</td> | <td class='linerow'>$filesize KB</td> | ||||
<td class='linerow'>$filetime</td></tr>"; | <td class='linerow'>$filetime</td></tr>"; | ||||
echo "$line"; | echo "$line"; | ||||
@@ -2,7 +2,7 @@ | |||||
/** | /** | ||||
* 模板发送 | * 模板发送 | ||||
* | * | ||||
* @version $Id: select_templets_post.php 2022-07-01 tianya $ | |||||
* @version $Id: select_templets_post.php 1 9:43 2010年7月8日Z tianya $ | |||||
* @package DedeBIZ.Dialog | * @package DedeBIZ.Dialog | ||||
* @copyright Copyright (c) 2022, DedeBIZ.COM | * @copyright Copyright (c) 2022, DedeBIZ.COM | ||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
@@ -14,15 +14,15 @@ if (empty($uploadfile)) { | |||||
$uploadfile = ""; | $uploadfile = ""; | ||||
} | } | ||||
if (!is_uploaded_file($uploadfile)) { | if (!is_uploaded_file($uploadfile)) { | ||||
ShowMsg(Lang("friendlink_err_imglogo_empty"), "-1"); | |||||
ShowMsg("您没有选择上传的文件", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (!preg_match("#^text#", $uploadfile_type)) { | if (!preg_match("#^text#", $uploadfile_type)) { | ||||
ShowMsg(Lang("dialog_template_err_upload"), "-1"); | |||||
ShowMsg("您上传的不是文本类型附件", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (!preg_match("#\.(".$cfg_txttype.")#i", $uploadfile_name)) { | if (!preg_match("#\.(".$cfg_txttype.")#i", $uploadfile_name)) { | ||||
ShowMsg(Lang("dialog_template_err_format"), "-1"); | |||||
ShowMsg("您所上传的模板文件类型不能被识别,只允许htm、html、tpl、txt扩展名", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if ($filename =='') { | if ($filename =='') { | ||||
@@ -30,12 +30,12 @@ if ($filename =='') { | |||||
} | } | ||||
$filename = trim(preg_replace("#[ \r\n\t\*\%\\\/\?><\|\":]{1,}#", '', $filename)); | $filename = trim(preg_replace("#[ \r\n\t\*\%\\\/\?><\|\":]{1,}#", '', $filename)); | ||||
if ($filename == '' || !preg_match("#\.(".$cfg_txttype.")#i", $filename)) { | if ($filename == '' || !preg_match("#\.(".$cfg_txttype.")#i", $filename)) { | ||||
ShowMsg(Lang("dialog_template_err_ftype"), "-1"); | |||||
ShowMsg("您所上传的文件存在问题,请检查文件类型是否适合", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$fullfilename = $cfg_basedir.$activepath."/".$filename; | $fullfilename = $cfg_basedir.$activepath."/".$filename; | ||||
move_uploaded_file($uploadfile, $fullfilename) or die(Lang('media_err_upload',array('filename'=>$fullfilename))); | |||||
move_uploaded_file($uploadfile, $fullfilename) or die("上传文件到 $fullfilename 失败"); | |||||
@unlink($uploadfile); | @unlink($uploadfile); | ||||
ShowMsg(Lang("dialog_soft_success_upload"), "select_templets.php?comeback=".urlencode($filename)."&f=$f&activepath=".urlencode($activepath)."&d=".time()); | |||||
ShowMsg("成功上传文件", "select_templets.php?comeback=".urlencode($filename)."&f=$f&activepath=".urlencode($activepath)."&d=".time()); | |||||
exit(); | exit(); | ||||
?> | ?> |
@@ -9,30 +9,29 @@ | |||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
use DedeBIZ\Login\UserLogin; | |||||
UserLogin::CheckPurview('c_New'); | |||||
CheckPurview('c_New'); | |||||
$mysql_version = $dsql->GetVersion(); | $mysql_version = $dsql->GetVersion(); | ||||
$mysql_versions = explode(".", trim($mysql_version)); | $mysql_versions = explode(".", trim($mysql_version)); | ||||
$mysql_version = $mysql_versions[0].".".$mysql_versions[1]; | $mysql_version = $mysql_versions[0].".".$mysql_versions[1]; | ||||
if (empty($action)) { | if (empty($action)) { | ||||
$row = $dsql->GetOne("SELECT diyid FROM `#@__diyforms` ORDER BY diyid DESC LIMIT 0,1 "); | |||||
$row = $dsql->GetOne("SELECT diyid FROM #@__diyforms ORDER BY diyid DESC LIMIT 0,1 "); | |||||
if (is_array($row)) $newdiyid = $row['diyid'] + 1; | if (is_array($row)) $newdiyid = $row['diyid'] + 1; | ||||
else $newdiyid = 1; | else $newdiyid = 1; | ||||
include(DEDEADMIN."/templets/diy_add.htm"); | include(DEDEADMIN."/templets/diy_add.htm"); | ||||
} else { | } else { | ||||
if (preg_match("#[^0-9-]#", $diyid) || empty($diyid)) { | if (preg_match("#[^0-9-]#", $diyid) || empty($diyid)) { | ||||
ShowMsg(Lang("diy_err_id_check"), "-1"); | |||||
ShowMsg("<span class='text-danger'>'自定义表单diyid'</span>必须为数字", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if ($table == "") { | if ($table == "") { | ||||
ShowMsg(Lang("diy_err_table_check"), "-1"); | |||||
ShowMsg("表名不能为空", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$public = isset($public) && is_numeric($public) ? $public : 0; | $public = isset($public) && is_numeric($public) ? $public : 0; | ||||
$name = dede_htmlspecialchars($name); | $name = dede_htmlspecialchars($name); | ||||
$row = $dsql->GetOne("SELECT * FROM `#@__diyforms` WHERE diyid='$diyid' OR `table` LIKE '$table' OR name LIKE '$name'"); | |||||
$row = $dsql->GetOne("SELECT * FROM `#@__diyforms` WHERE diyid='$diyid' OR `table` LIKE '$table' OR name LIKE '$name' "); | |||||
if (is_array($row)) { | if (is_array($row)) { | ||||
ShowMsg(Lang("diy_err_diyid_exists"), "-1"); | |||||
ShowMsg("可能自定义表单的‘diyid’、‘名称’在数据库中已存在,不能重复使用", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if ($cfg_dbtype=="sqlite") { | if ($cfg_dbtype=="sqlite") { | ||||
@@ -45,7 +44,7 @@ if (empty($action)) { | |||||
while ($row = $dsql->GetArray("biz")) { | while ($row = $dsql->GetArray("biz")) { | ||||
if (empty($row[0])) $row[0] = ''; | if (empty($row[0])) $row[0] = ''; | ||||
if ($table == $row[0]) { | if ($table == $row[0]) { | ||||
showmsg(Lang('diy_err_table_exists'), '-1'); | |||||
showmsg('指定的表在数据库中重复', '-1'); | |||||
exit(); | exit(); | ||||
} | } | ||||
} | } | ||||
@@ -59,11 +58,11 @@ if (empty($action)) { | |||||
$sql .= " PRIMARY KEY (`id`)\r\n) ENGINE=MyISAM DEFAULT CHARSET=".$cfg_db_language."; "; | $sql .= " PRIMARY KEY (`id`)\r\n) ENGINE=MyISAM DEFAULT CHARSET=".$cfg_db_language."; "; | ||||
} | } | ||||
if ($dsql->ExecuteNoneQuery($sql)) { | if ($dsql->ExecuteNoneQuery($sql)) { | ||||
$query = "INSERT INTO `#@__diyforms` (`diyid`, `name`, `table`, `info`, `listtemplate`, `viewtemplate`, `posttemplate`, `public` ) VALUES ('$diyid', '$name', '$table', '', '$listtemplate', '$viewtemplate', '$posttemplate', '$public')"; | |||||
$query = "INSERT INTO `#@__diyforms` (`diyid`,`name`,`table`,`info`,`listtemplate`,`viewtemplate`,`posttemplate`,`public` ) VALUES ('$diyid','$name','$table','','$listtemplate','$viewtemplate','$posttemplate','$public')"; | |||||
$dsql->ExecuteNoneQuery($query); | $dsql->ExecuteNoneQuery($query); | ||||
showmsg(Lang('diy_add_success'), 'diy_main.php'); | |||||
showmsg('自定义表单创建成功,请自行添加字段', 'diy_main.php'); | |||||
} else { | } else { | ||||
showmsg(Lang('diy_err_add'), '-1'); | |||||
showmsg('自定义表单创建失败', '-1'); | |||||
} | } | ||||
} | } | ||||
?> | ?> |
@@ -8,53 +8,63 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DedeWin; | |||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('c_Edit'); | |||||
CheckPurview('c_Edit'); | |||||
require_once(DEDEINC."/dedetag.class.php"); | |||||
require_once(DEDEINC."/libraries/oxwindow.class.php"); | |||||
if (empty($dopost)) $dopost = ""; | if (empty($dopost)) $dopost = ""; | ||||
$diyid = (empty($diyid) ? 0 : intval($diyid)); | $diyid = (empty($diyid) ? 0 : intval($diyid)); | ||||
/*---------------- | |||||
function __SaveEdit() | |||||
-----------------*/ | |||||
if ($dopost == "save") { | if ($dopost == "save") { | ||||
$public = isset($public) && is_numeric($public) ? $public : 0; | $public = isset($public) && is_numeric($public) ? $public : 0; | ||||
$name = dede_htmlspecialchars($name); | $name = dede_htmlspecialchars($name); | ||||
$query = "UPDATE `#@__diyforms` SET name='$name',listtemplate='$listtemplate',viewtemplate='$viewtemplate',posttemplate='$posttemplate',public='$public' WHERE diyid='$diyid'"; | |||||
$query = "UPDATE `#@__diyforms` SET name = '$name', listtemplate='$listtemplate', viewtemplate='$viewtemplate', posttemplate='$posttemplate', public='$public' WHERE diyid='$diyid' "; | |||||
$dsql->ExecuteNoneQuery($query); | $dsql->ExecuteNoneQuery($query); | ||||
ShowMsg(Lang("diy_success_edit"), "diy_main.php"); | |||||
ShowMsg("成功修改一个自定义表单", "diy_main.php"); | |||||
exit(); | exit(); | ||||
} | } | ||||
/*---------------- | |||||
function __Delete() | |||||
-----------------*/ | |||||
else if ($dopost == "delete") { | else if ($dopost == "delete") { | ||||
@set_time_limit(0); | @set_time_limit(0); | ||||
UserLogin::CheckPurview('c_Del'); | |||||
CheckPurview('c_Del'); | |||||
$row = $dsql->GetOne("SELECT * FROM `#@__diyforms` WHERE diyid='$diyid'"); | $row = $dsql->GetOne("SELECT * FROM `#@__diyforms` WHERE diyid='$diyid'"); | ||||
if (empty($job)) $job = ""; | if (empty($job)) $job = ""; | ||||
//确认提示 | //确认提示 | ||||
if ($job == "") { | if ($job == "") { | ||||
$wintitle = Lang('diy_main')."-".Lang('diy_delete'); | |||||
$wecome_info = "<a href='diy_main.php'>".Lang('diy_main')."</a>::".Lang('diy_delete'); | |||||
DedeWin::Instance()->Init("diy_edit.php", "js/blank.js", "POST") | |||||
->AddHidden("job", "yes") | |||||
->AddHidden("dopost", $dopost) | |||||
->AddHidden("diyid", $diyid) | |||||
->AddTitle(Lang("diy_delete_title",array("name"=>$row['name']))) | |||||
->GetWindow("ok") | |||||
->Display(); | |||||
$wintitle = "自定义表单管理-删除自定义表单"; | |||||
$wecome_info = "<a href='diy_main.php'>自定义表单管理</a>::删除自定义表单"; | |||||
$win = new OxWindow(); | |||||
$win->Init("diy_edit.php", "js/blank.js", "POST"); | |||||
$win->AddHidden("job", "yes"); | |||||
$win->AddHidden("dopost", $dopost); | |||||
$win->AddHidden("diyid", $diyid); | |||||
$win->AddTitle("将删除所有与该自定义表单相关的文件和数据<br>您确定要删除 \"".$row['name']."\" 这个自定义表单?"); | |||||
$winform = $win->GetWindow("ok"); | |||||
$win->Display(); | |||||
exit(); | exit(); | ||||
} | } | ||||
//操作 | //操作 | ||||
else if ($job == "yes") { | else if ($job == "yes") { | ||||
$row = $dsql->GetOne("SELECT `table` FROM `#@__diyforms` WHERE diyid='$diyid'", PDO::FETCH_ASSOC); | |||||
$row = $dsql->GetOne("SELECT `table` FROM `#@__diyforms` WHERE diyid='$diyid'", MYSQL_ASSOC); | |||||
if (!is_array($row)) { | if (!is_array($row)) { | ||||
ShowMsg(Lang("diy_err_not_exists"), "-1"); | |||||
ShowMsg("您所指定的自定义表单信息不存在!", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
//删除表 | //删除表 | ||||
$dsql->ExecuteNoneQuery("DROP TABLE IF EXISTS `{$row['table']}`;"); | $dsql->ExecuteNoneQuery("DROP TABLE IF EXISTS `{$row['table']}`;"); | ||||
//删除频道配置信息 | //删除频道配置信息 | ||||
$dsql->ExecuteNoneQuery("DELETE FROM `#@__diyforms` WHERE diyid='$diyid'"); | $dsql->ExecuteNoneQuery("DELETE FROM `#@__diyforms` WHERE diyid='$diyid'"); | ||||
ShowMsg(Lang("diy_success_delete"), "diy_main.php"); | |||||
ShowMsg("成功删除一个自定义表单", "diy_main.php"); | |||||
exit(); | exit(); | ||||
} | } | ||||
} | } | ||||
/*---------------- | |||||
function edit() | |||||
-----------------*/ | |||||
$row = $dsql->GetOne("SELECT * FROM `#@__diyforms` WHERE diyid='$diyid'"); | $row = $dsql->GetOne("SELECT * FROM `#@__diyforms` WHERE diyid='$diyid'"); | ||||
include DEDEADMIN."/templets/diy_edit.htm"; | include DEDEADMIN."/templets/diy_edit.htm"; | ||||
?> | ?> |
@@ -8,7 +8,6 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Template\DedeTagParse; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
//增加权限检查 | //增加权限检查 | ||||
require_once(DEDEADMIN.'/inc/inc_admin_channel.php'); | require_once(DEDEADMIN.'/inc/inc_admin_channel.php'); | ||||
@@ -16,11 +15,15 @@ if (empty($action)) $action = ''; | |||||
$mysql_version = $dsql->GetVersion(); | $mysql_version = $dsql->GetVersion(); | ||||
$mysql_versions = explode(".", trim($mysql_version)); | $mysql_versions = explode(".", trim($mysql_version)); | ||||
$mysql_version = $mysql_versions[0].".".$mysql_versions[1]; | $mysql_version = $mysql_versions[0].".".$mysql_versions[1]; | ||||
/*---------------------- | |||||
function Save() | |||||
---------------------*/ | |||||
if ($action == 'save') { | if ($action == 'save') { | ||||
//模型信息 | //模型信息 | ||||
$fieldname = strtolower($fieldname); | $fieldname = strtolower($fieldname); | ||||
$row = $dsql->GetOne("SELECT `table`,`info` FROM `#@__diyforms` WHERE diyid='$diyid'"); | $row = $dsql->GetOne("SELECT `table`,`info` FROM `#@__diyforms` WHERE diyid='$diyid'"); | ||||
$fieldset = stripslashes($row['info']); | $fieldset = stripslashes($row['info']); | ||||
require_once(DEDEINC."/dedetag.class.php"); | |||||
$dtp = new DedeTagParse(); | $dtp = new DedeTagParse(); | ||||
$dtp->SetNameSpace("field", "<", ">"); | $dtp->SetNameSpace("field", "<", ">"); | ||||
$dtp->LoadSource($fieldset); | $dtp->LoadSource($fieldset); | ||||
@@ -36,7 +39,7 @@ if ($action == 'save') { | |||||
$rs = $dsql->ExecuteNoneQuery(" ALTER TABLE `$trueTable` ADD $ntabsql "); | $rs = $dsql->ExecuteNoneQuery(" ALTER TABLE `$trueTable` ADD $ntabsql "); | ||||
if (!$rs) { | if (!$rs) { | ||||
$gerr = $dsql->GetError(); | $gerr = $dsql->GetError(); | ||||
ShowMsg(Lang("mychannel_field_err_add",array("err"=>$gerr)), "javascript:;"); | |||||
ShowMsg("增加字段失败,错误提示为:".$gerr, "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$ok = FALSE; | $ok = FALSE; | ||||
@@ -57,17 +60,20 @@ if ($action == 'save') { | |||||
} | } | ||||
$addlist = GetAddFieldList($dtp, $oksetting); | $addlist = GetAddFieldList($dtp, $oksetting); | ||||
$oksetting = addslashes($oksetting); | $oksetting = addslashes($oksetting); | ||||
$rs = $dsql->ExecuteNoneQuery("Update #@__diyforms set `info`='$oksetting' where diyid='$diyid'"); | |||||
$rs = $dsql->ExecuteNoneQuery("Update #@__diyforms set `info`='$oksetting' where diyid='$diyid' "); | |||||
if (!$rs) { | if (!$rs) { | ||||
$grr = $dsql->GetError(); | $grr = $dsql->GetError(); | ||||
ShowMsg(Lang('mychannel_field_err_savenode',array('err'=>$grr)), "javascript:;"); | |||||
ShowMsg("保存节点配置出错".$grr, "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
ShowMsg(Lang("mychannel_field_add_success"), "diy_edit.php?diyid=$diyid"); | |||||
ShowMsg("成功增加一个字段", "diy_edit.php?diyid=$diyid"); | |||||
exit(); | exit(); | ||||
} | } | ||||
//检测模型相关信息,并初始化相关数据 | //检测模型相关信息,并初始化相关数据 | ||||
$row = $dsql->GetOne("SELECT `table` FROM `#@__diyforms` WHERE diyid='$diyid'"); | |||||
/*---------------------- | |||||
function ShowPage() | |||||
---------------------*/ | |||||
$row = $dsql->GetOne("SELECT `table` FROM #@__diyforms WHERE diyid='$diyid'"); | |||||
$trueTable = $row['table']; | $trueTable = $row['table']; | ||||
$tabsql = "CREATE TABLE IF NOT EXISTS `$trueTable`( | $tabsql = "CREATE TABLE IF NOT EXISTS `$trueTable`( | ||||
`id` int(10) unsigned NOT NULL auto_increment, | `id` int(10) unsigned NOT NULL auto_increment, | ||||
@@ -83,7 +89,7 @@ $dsql->ExecuteNoneQuery($tabsql); | |||||
$fields = array(); | $fields = array(); | ||||
$rs = $dsql->SetQuery("show fields from `$trueTable`"); | $rs = $dsql->SetQuery("show fields from `$trueTable`"); | ||||
$dsql->Execute('a'); | $dsql->Execute('a'); | ||||
while ($nrow = $dsql->GetArray('a', PDO::FETCH_ASSOC)) { | |||||
while ($nrow = $dsql->GetArray('a', MYSQL_ASSOC)) { | |||||
$fields[strtolower($nrow['Field'])] = 1; | $fields[strtolower($nrow['Field'])] = 1; | ||||
} | } | ||||
$f = ''; | $f = ''; | ||||
@@ -8,9 +8,9 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Template\DedeTagParse; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
//增加权限检查 | //增加权限检查 | ||||
require_once(DEDEINC."/dedetag.class.php"); | |||||
require_once(DEDEADMIN."/inc/inc_admin_channel.php"); | require_once(DEDEADMIN."/inc/inc_admin_channel.php"); | ||||
if (empty($action)) $action = ''; | if (empty($action)) $action = ''; | ||||
//获取模型信息 | //获取模型信息 | ||||
@@ -33,9 +33,12 @@ foreach ($ds as $d) { | |||||
$fieldtypes[$dds[0]] = $dds[1]; | $fieldtypes[$dds[0]] = $dds[1]; | ||||
} | } | ||||
//保存修改 | //保存修改 | ||||
/*-------------------- | |||||
function _SAVE() | |||||
----------------------*/ | |||||
if ($action == 'save') { | if ($action == 'save') { | ||||
if (!isset($fieldtypes[$dtype])) { | if (!isset($fieldtypes[$dtype])) { | ||||
ShowMsg(Lang("mychannel_field_err_edit"), "-1"); | |||||
ShowMsg("您修改的是系统专用类型的数据,禁止操作", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
//检测数据库是否存在附加表,不存在则新建一个 | //检测数据库是否存在附加表,不存在则新建一个 | ||||
@@ -53,7 +56,7 @@ if ($action == 'save') { | |||||
$fields = array(); | $fields = array(); | ||||
$rs = $dsql->SetQuery("show fields from `$trueTable`"); | $rs = $dsql->SetQuery("show fields from `$trueTable`"); | ||||
$dsql->Execute('a'); | $dsql->Execute('a'); | ||||
while ($nrow = $dsql->GetArray('a', PDO::FETCH_ASSOC)) { | |||||
while ($nrow = $dsql->GetArray('a', MYSQL_ASSOC)) { | |||||
$fields[strtolower($nrow['Field'])] = $nrow['Type']; | $fields[strtolower($nrow['Field'])] = $nrow['Type']; | ||||
} | } | ||||
//修改字段配置信息 | //修改字段配置信息 | ||||
@@ -84,11 +87,14 @@ if ($action == 'save') { | |||||
} | } | ||||
$oksetting = $dtp->GetResultNP(); | $oksetting = $dtp->GetResultNP(); | ||||
$oksetting = addslashes($oksetting); | $oksetting = addslashes($oksetting); | ||||
$dsql->ExecuteNoneQuery("UPDATE `#@__diyforms` SET info='$oksetting' WHERE diyid='$diyid'"); | |||||
ShowMsg(Lang("mychannel_field_success_edit"), "diy_edit.php?diyid={$diyid}"); | |||||
$dsql->ExecuteNoneQuery("UPDATE #@__diyforms SET info='$oksetting' WHERE diyid='$diyid' "); | |||||
ShowMsg("成功修改一个字段的配置", "diy_edit.php?diyid={$diyid}"); | |||||
exit(); | exit(); | ||||
} | } | ||||
//删除字段 | |||||
/*------------------ | |||||
删除字段 | |||||
function _DELETE() | |||||
-------------------*/ | |||||
else if ($action == "delete") { | else if ($action == "delete") { | ||||
//检测旧数据类型,并替换为新配置 | //检测旧数据类型,并替换为新配置 | ||||
foreach ($dtp->CTags as $tagid => $ctag) { | foreach ($dtp->CTags as $tagid => $ctag) { | ||||
@@ -97,9 +103,9 @@ else if ($action == "delete") { | |||||
} | } | ||||
} | } | ||||
$oksetting = addslashes($dtp->GetResultNP()); | $oksetting = addslashes($dtp->GetResultNP()); | ||||
$dsql->ExecuteNoneQuery("UPDATE `#@__diyforms` SET info='$oksetting' WHERE diyid='$diyid'"); | |||||
$dsql->ExecuteNoneQuery("ALTER TABLE `$trueTable` DROP `$fname`"); | |||||
ShowMsg(Lang("mychannel_field_delete_success"), "diy_edit.php?diyid=$diyid"); | |||||
$dsql->ExecuteNoneQuery("UPDATE #@__diyforms SET info='$oksetting' WHERE diyid='$diyid' "); | |||||
$dsql->ExecuteNoneQuery("ALTER TABLE `$trueTable` DROP `$fname` "); | |||||
ShowMsg("成功删除一个字段", "diy_edit.php?diyid=$diyid"); | |||||
exit(); | exit(); | ||||
} | } | ||||
require_once(DEDEADMIN."/templets/diy_field_edit.htm"); | require_once(DEDEADMIN."/templets/diy_field_edit.htm"); |
@@ -8,18 +8,16 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Archive\DiyForm; | |||||
use DedeBIZ\libraries\DataListCP; | |||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('c_New'); | |||||
CheckPurview('c_New'); | |||||
$diyid = isset($diyid) && is_numeric($diyid) ? $diyid : 0; | $diyid = isset($diyid) && is_numeric($diyid) ? $diyid : 0; | ||||
$action = isset($action) && in_array($action, array('post', 'list', 'edit', 'check', 'delete','excel')) ? $action : ''; | $action = isset($action) && in_array($action, array('post', 'list', 'edit', 'check', 'delete','excel')) ? $action : ''; | ||||
if (empty($diyid)) { | if (empty($diyid)) { | ||||
showMsg(Lang("illegal_operation"), 'javascript:;'); | |||||
showMsg("非法操作", 'javascript:;'); | |||||
exit(); | exit(); | ||||
} | } | ||||
$diy = new DiyForm($diyid); | |||||
require_once DEDEINC.'/diyform.class.php'; | |||||
$diy = new diyform($diyid); | |||||
if ($action == 'post') { | if ($action == 'post') { | ||||
if (empty($do)) { | if (empty($do)) { | ||||
$postform = $diy->getForm('post', '', 'admin'); | $postform = $diy->getForm('post', '', 'admin'); | ||||
@@ -29,13 +27,13 @@ if ($action == 'post') { | |||||
$dede_fieldshash = empty($dede_fieldshash) ? '' : trim($dede_fieldshash); | $dede_fieldshash = empty($dede_fieldshash) ? '' : trim($dede_fieldshash); | ||||
if (!empty($dede_fields)) { | if (!empty($dede_fields)) { | ||||
if ($dede_fieldshash != md5($dede_fields.$cfg_cookie_encode)) { | if ($dede_fieldshash != md5($dede_fields.$cfg_cookie_encode)) { | ||||
showMsg(Lang("diy_err_checkdata"), '-1'); | |||||
showMsg("数据校验不对,程序返回", '-1'); | |||||
exit(); | exit(); | ||||
} | } | ||||
} | } | ||||
$diyform = $dsql->getOne("SELECT * FROM `#@__diyforms` WHERE diyid=$diyid"); | $diyform = $dsql->getOne("SELECT * FROM `#@__diyforms` WHERE diyid=$diyid"); | ||||
if (!is_array($diyform)) { | if (!is_array($diyform)) { | ||||
showmsg(Lang("diy_err_not_exists"), '-1'); | |||||
showmsg("自定义表单不存在", '-1'); | |||||
exit(); | exit(); | ||||
} | } | ||||
$addvar = $addvalue = ''; | $addvar = $addvalue = ''; | ||||
@@ -59,15 +57,16 @@ if ($action == 'post') { | |||||
} | } | ||||
} | } | ||||
} | } | ||||
$query = "INSERT INTO `{$diy->table}` (`id`, `ifcheck` $addvar) VALUES (NULL, 0 $addvalue)"; | |||||
$query = "INSERT INTO `{$diy->table}` (`id`, `ifcheck` $addvar) VALUES (NULL, 0 $addvalue)"; | |||||
if ($dsql->ExecuteNoneQuery($query)) { | if ($dsql->ExecuteNoneQuery($query)) { | ||||
$goto = "diy_list.php?action=list&diyid={$diy->diyid}"; | $goto = "diy_list.php?action=list&diyid={$diy->diyid}"; | ||||
showmsg(Lang('diy_success_send'), $goto); | |||||
showmsg('发布成功', $goto); | |||||
} else { | } else { | ||||
showmsg(Lang('diy_err_send'), '-1'); | |||||
showmsg('对不起,发布不成功', '-1'); | |||||
} | } | ||||
} | } | ||||
} else if ($action == 'list') { | } else if ($action == 'list') { | ||||
include_once DEDEINC.'/datalistcp.class.php'; | |||||
$query = "SELECT * FROM {$diy->table} ORDER BY id DESC"; | $query = "SELECT * FROM {$diy->table} ORDER BY id DESC"; | ||||
$datalist = new DataListCP(); | $datalist = new DataListCP(); | ||||
$datalist->pagesize = 30; | $datalist->pagesize = 30; | ||||
@@ -81,13 +80,13 @@ if ($action == 'post') { | |||||
if (empty($do)) { | if (empty($do)) { | ||||
$id = isset($id) && is_numeric($id) ? $id : 0; | $id = isset($id) && is_numeric($id) ? $id : 0; | ||||
if (empty($id)) { | if (empty($id)) { | ||||
showMsg(Lang('diy_err_no_select'), 'javascript:;'); | |||||
showMsg('非法操作未指定id', 'javascript:;'); | |||||
exit(); | exit(); | ||||
} | } | ||||
$query = "SELECT * FROM {$diy->table} WHERE id=$id"; | $query = "SELECT * FROM {$diy->table} WHERE id=$id"; | ||||
$row = $dsql->GetOne($query); | $row = $dsql->GetOne($query); | ||||
if (!is_array($row)) { | if (!is_array($row)) { | ||||
showmsg(Lang("diy_err_not_exists"), '-1'); | |||||
showmsg("您访问的记录不存在或未经审核", '-1'); | |||||
exit(); | exit(); | ||||
} | } | ||||
$postform = $diy->getForm('edit', $row, 'admin'); | $postform = $diy->getForm('edit', $row, 'admin'); | ||||
@@ -100,7 +99,7 @@ if ($action == 'post') { | |||||
$diyform = $dsql->GetOne("SELECT * FROM `#@__diyforms` WHERE diyid=$diyid"); | $diyform = $dsql->GetOne("SELECT * FROM `#@__diyforms` WHERE diyid=$diyid"); | ||||
$diyco = $dsql->GetOne("SELECT * FROM `$diy->table` WHERE id='$id'"); | $diyco = $dsql->GetOne("SELECT * FROM `$diy->table` WHERE id='$id'"); | ||||
if (!is_array($diyform)) { | if (!is_array($diyform)) { | ||||
showmsg(Lang("diy_err_not_exists"), '-1'); | |||||
showmsg("自定义表单不存在", '-1'); | |||||
exit(); | exit(); | ||||
} | } | ||||
$addsql = ''; | $addsql = ''; | ||||
@@ -129,50 +128,50 @@ if ($action == 'post') { | |||||
$query = "UPDATE `$diy->table` SET $addsql WHERE id=$id"; | $query = "UPDATE `$diy->table` SET $addsql WHERE id=$id"; | ||||
if ($dsql->ExecuteNoneQuery($query)) { | if ($dsql->ExecuteNoneQuery($query)) { | ||||
$goto = "diy_list.php?action=list&diyid={$diy->diyid}"; | $goto = "diy_list.php?action=list&diyid={$diy->diyid}"; | ||||
showmsg(Lang('operation_successful'), $goto); | |||||
showmsg('编辑成功', $goto); | |||||
} else { | } else { | ||||
showmsg(Lang('operation_successful'), '-1'); | |||||
showmsg('编辑成功', '-1'); | |||||
} | } | ||||
} | } | ||||
} elseif ($action == 'check') { | } elseif ($action == 'check') { | ||||
if (is_array($id) && is_all_numeric($id)) { | if (is_array($id) && is_all_numeric($id)) { | ||||
$ids = implode(',', $id); | $ids = implode(',', $id); | ||||
} else { | } else { | ||||
showmsg(Lang('diy_err_no_select'), '-1'); | |||||
showmsg('未选中要操作的内容', '-1'); | |||||
exit(); | exit(); | ||||
} | } | ||||
$query = "UPDATE `$diy->table` SET ifcheck=1 WHERE id IN ($ids)"; | $query = "UPDATE `$diy->table` SET ifcheck=1 WHERE id IN ($ids)"; | ||||
if ($dsql->ExecuteNoneQuery($query)) { | if ($dsql->ExecuteNoneQuery($query)) { | ||||
showmsg(Lang('operation_successful'), "diy_list.php?action=list&diyid={$diy->diyid}"); | |||||
showmsg('审核成功', "diy_list.php?action=list&diyid={$diy->diyid}"); | |||||
} else { | } else { | ||||
showmsg(Lang('operation_failed'), "diy_list.php?action=list&diyid={$diy->diyid}"); | |||||
showmsg('审核失败', "diy_list.php?action=list&diyid={$diy->diyid}"); | |||||
} | } | ||||
} elseif ($action == 'delete') { | } elseif ($action == 'delete') { | ||||
if (empty($do)) { | if (empty($do)) { | ||||
if (is_array($id)) { | if (is_array($id)) { | ||||
$ids = implode(',', $id); | $ids = implode(',', $id); | ||||
} else { | } else { | ||||
showmsg(Lang('diy_err_no_select'), '-1'); | |||||
showmsg('未选中要操作的内容', '-1'); | |||||
exit(); | exit(); | ||||
} | } | ||||
$query = "DELETE FROM `$diy->table` WHERE id IN ($ids)"; | $query = "DELETE FROM `$diy->table` WHERE id IN ($ids)"; | ||||
if ($dsql->ExecuteNoneQuery($query)) { | if ($dsql->ExecuteNoneQuery($query)) { | ||||
showmsg(Lang('operation_successful'), "diy_list.php?action=list&diyid={$diy->diyid}"); | |||||
showmsg('删除成功', "diy_list.php?action=list&diyid={$diy->diyid}"); | |||||
} else { | } else { | ||||
showmsg(Lang('operation_failed'), "diy_list.php?action=list&diyid={$diy->diyid}"); | |||||
showmsg('删除失败', "diy_list.php?action=list&diyid={$diy->diyid}"); | |||||
} | } | ||||
} else if ($do = 1) { | } else if ($do = 1) { | ||||
$row = $dsql->GetOne("SELECT * FROM `$diy->table` WHERE id='$id'"); | $row = $dsql->GetOne("SELECT * FROM `$diy->table` WHERE id='$id'"); | ||||
if (file_exists($cfg_basedir.$row[$name])) { | if (file_exists($cfg_basedir.$row[$name])) { | ||||
unlink($cfg_basedir.$row[$name]); | unlink($cfg_basedir.$row[$name]); | ||||
$dsql->ExecuteNoneQuery("UPDATE `$diy->table` SET $name='' WHERE id='$id'"); | $dsql->ExecuteNoneQuery("UPDATE `$diy->table` SET $name='' WHERE id='$id'"); | ||||
showmsg(Lang('operation_successful'), "diy_list.php?action=list&diyid={$diy->diyid}"); | |||||
showmsg('文件删除成功', "diy_list.php?action=list&diyid={$diy->diyid}"); | |||||
} else { | } else { | ||||
showmsg(Lang('diy_err_file_notexists'), '-1'); | |||||
showmsg('文件不存在', '-1'); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
elseif ($action == 'excel') { | |||||
elseif($action == 'excel') { | |||||
ob_end_clean();//清除缓冲区,避免乱码 | ob_end_clean();//清除缓冲区,避免乱码 | ||||
header("Content-type:application/vnd.ms-excel"); | header("Content-type:application/vnd.ms-excel"); | ||||
header("Content-Disposition:attachment;filename={$diy->name}_".date("Y-m-d").".xls"); | header("Content-Disposition:attachment;filename={$diy->name}_".date("Y-m-d").".xls"); | ||||
@@ -183,7 +182,7 @@ elseif ($action == 'excel') { | |||||
{ | { | ||||
echo "<th>{$fielddata[0]}</th>"; | echo "<th>{$fielddata[0]}</th>"; | ||||
} | } | ||||
echo "<th>".Lang('status')."</th>"; | |||||
echo "<th>状态</th>"; | |||||
echo "</tr>"; | echo "</tr>"; | ||||
$sql = "SELECT * FROM {$diy->table} ORDER BY id DESC"; | $sql = "SELECT * FROM {$diy->table} ORDER BY id DESC"; | ||||
$dsql->SetQuery($sql); | $dsql->SetQuery($sql); | ||||
@@ -195,12 +194,12 @@ elseif ($action == 'excel') { | |||||
{ | { | ||||
echo "<td>".$arr[$key]."</td>"; | echo "<td>".$arr[$key]."</td>"; | ||||
} | } | ||||
$status = $arr['ifcheck'] == 1 ? Lang('reviewed') : Lang('not_approved'); | |||||
$status = $arr['ifcheck'] == 1 ? '已审核' : '未审核'; | |||||
echo "<td>".$status."</td>"; | echo "<td>".$status."</td>"; | ||||
echo "</tr>"; | echo "</tr>"; | ||||
} | } | ||||
echo "</table>"; | echo "</table>"; | ||||
} else { | } else { | ||||
showmsg(Lang("illegal_operation"), "-1"); | |||||
showmsg('未定义操作', "-1"); | |||||
} | } | ||||
?> | ?> |
@@ -8,13 +8,12 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DataListCP; | |||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('c_List'); | |||||
CheckPurview('c_List'); | |||||
require_once(DEDEINC."/datalistcp.class.php"); | |||||
require_once(DEDEINC."/common.func.php"); | require_once(DEDEINC."/common.func.php"); | ||||
setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/"); | setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/"); | ||||
$sql = "SELECT `diyid`,`name`,`table` FROM `#@__diyforms` ORDER BY diyid ASC"; | |||||
$sql = "Select `diyid`,`name`,`table` From #@__diyforms order by diyid asc"; | |||||
$dlist = new DataListCP(); | $dlist = new DataListCP(); | ||||
$dlist->SetTemplet(DEDEADMIN."/templets/diy_main.htm"); | $dlist->SetTemplet(DEDEADMIN."/templets/diy_main.htm"); | ||||
$dlist->SetSource($sql); | $dlist->SetSource($sql); | ||||
@@ -8,9 +8,8 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DataListCP; | |||||
use DedeBIZ\libraries\DedeWin; | |||||
require_once(dirname(__FILE__).'/config.php'); | require_once(dirname(__FILE__).'/config.php'); | ||||
require_once(DEDEINC.'/datalistcp.class.php'); | |||||
require_once(DEDEINC.'/common.func.php'); | require_once(DEDEINC.'/common.func.php'); | ||||
if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
if (empty($fmdo)) $fmdo = ''; | if (empty($fmdo)) $fmdo = ''; | ||||
@@ -18,7 +17,7 @@ function username($mid) | |||||
{ | { | ||||
global $dsql; | global $dsql; | ||||
if (!isset($mid) || empty($mid)) { | if (!isset($mid) || empty($mid)) { | ||||
return Lang("tourist"); | |||||
return "游客"; | |||||
exit(); | exit(); | ||||
} else { | } else { | ||||
$sql = "SELECT uname FROM `#@__member` WHERE `mid` = '$mid'"; | $sql = "SELECT uname FROM `#@__member` WHERE `mid` = '$mid'"; | ||||
@@ -32,34 +31,34 @@ function typename($me) | |||||
{ | { | ||||
switch ($me) { | switch ($me) { | ||||
case $me == 1: | case $me == 1: | ||||
return $me = Lang("erraddsave_type_1"); | |||||
return $me = "错别字"; | |||||
break; | break; | ||||
case $me == 2: | case $me == 2: | ||||
return $me = Lang("erraddsave_type_2"); | |||||
return $me = "成语运用不当"; | |||||
break; | break; | ||||
case $me == 3: | case $me == 3: | ||||
return $me = Lang("erraddsave_type_3"); | |||||
return $me = "专业术语写法不规则"; | |||||
break; | break; | ||||
case $me == 4: | case $me == 4: | ||||
return $me = Lang("erraddsave_type_4"); | |||||
return $me = "产品与图片不符"; | |||||
break; | break; | ||||
case $me == 5: | case $me == 5: | ||||
return $me = Lang("erraddsave_type_5"); | |||||
return $me = "事实年代以及内容错误"; | |||||
break; | break; | ||||
case $me == 6: | case $me == 6: | ||||
return $me = Lang("erraddsave_type_6"); | |||||
return $me = "事实年代以及内容错误"; | |||||
break; | break; | ||||
case $me == 7: | case $me == 7: | ||||
return $me = Lang("erraddsave_type_7"); | |||||
return $me = "其他错误"; | |||||
break; | break; | ||||
default: | default: | ||||
return $me = Lang("erraddsave_type_unknow"); | |||||
return $me = "未知错误"; | |||||
break; | break; | ||||
} | } | ||||
} | } | ||||
if ($dopost == "delete") { | if ($dopost == "delete") { | ||||
if ($id == '') { | if ($id == '') { | ||||
ShowMsg(Lang("invalid_parameter"), "-1"); | |||||
ShowMsg("参数无效", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
if ($fmdo == 'yes') { | if ($fmdo == 'yes') { | ||||
@@ -68,23 +67,25 @@ if ($dopost == "delete") { | |||||
$query = "DELETE FROM `#@__erradd` WHERE `id` = '$var'"; | $query = "DELETE FROM `#@__erradd` WHERE `id` = '$var'"; | ||||
$dsql->ExecuteNoneQuery($query); | $dsql->ExecuteNoneQuery($query); | ||||
} | } | ||||
ShowMsg(Lang("content_delete_success"), "erraddsave.php"); | |||||
ShowMsg("成功删除指定的文档", "erraddsave.php"); | |||||
exit(); | exit(); | ||||
} else { | } else { | ||||
$wintitle = Lang("delete"); | |||||
$wecome_info = "<a href='erraddsave.php'>".Lang('erraddsave')."</a>::".Lang('erraddsave_delete'); | |||||
DedeWin::Instance()->Init("erraddsave.php", "js/blank.js", "POST") | |||||
->AddHidden("fmdo", "yes") | |||||
->AddHidden("dopost", $dopost) | |||||
->AddHidden("id", $id) | |||||
->AddTitle(Lang('content_delete_confirm',array('qstr'=>$id))) | |||||
->GetWindow("ok") | |||||
->Display(); | |||||
require_once(DEDEINC."/libraries/oxwindow.class.php"); | |||||
$wintitle = "删除"; | |||||
$wecome_info = "<a href='erraddsave.php'>错误管理</a>::删除错误"; | |||||
$win = new OxWindow(); | |||||
$win->Init("erraddsave.php", "js/blank.js", "POST"); | |||||
$win->AddHidden("fmdo", "yes"); | |||||
$win->AddHidden("dopost", $dopost); | |||||
$win->AddHidden("id", $id); | |||||
$win->AddTitle("您确定要删除“ $id ”这些错误提示"); | |||||
$winform = $win->GetWindow("ok"); | |||||
$win->Display(); | |||||
exit(); | exit(); | ||||
} | } | ||||
exit(); | exit(); | ||||
} | } | ||||
$sql = "SELECT * FROM `#@__erradd` ORDER BY id DESC"; | |||||
$sql = "SELECT * FROM `#@__erradd` ORDER BY id desc"; | |||||
$dlist = new DataListCP(); | $dlist = new DataListCP(); | ||||
$dlist->SetTemplet(DEDEADMIN."/templets/erradd.htm"); | $dlist->SetTemplet(DEDEADMIN."/templets/erradd.htm"); | ||||
$dlist->SetSource($sql); | $dlist->SetSource($sql); | ||||
@@ -8,15 +8,15 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__).'/../system/common.inc.php'); | require_once(dirname(__FILE__).'/../system/common.inc.php'); | ||||
$cUserLogin = new UserLogin(); | |||||
$cUserLogin->exitUser(); | |||||
require_once(DEDEINC.'/userlogin.class.php'); | |||||
$cuserLogin = new userLogin(); | |||||
$cuserLogin->exitUser(); | |||||
if (empty($needclose)) { | if (empty($needclose)) { | ||||
header('location:index.php'); | header('location:index.php'); | ||||
} else { | } else { | ||||
$msg = "<script> | $msg = "<script> | ||||
if (document.all) window.opener=true; | |||||
if(document.all) window.opener=true; | |||||
window.close(); | window.close(); | ||||
</script>"; | </script>"; | ||||
echo $msg; | echo $msg; | ||||
@@ -8,9 +8,8 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('sys_Feedback'); | |||||
CheckPurview('sys_Feedback'); | |||||
$id = isset($id) && is_numeric($id) ? $id : 0; | $id = isset($id) && is_numeric($id) ? $id : 0; | ||||
$ENV_GOBACK_URL = empty($_COOKIE['ENV_GOBACK_URL']) ? "feedback_main.php" : $_COOKIE['ENV_GOBACK_URL']; | $ENV_GOBACK_URL = empty($_COOKIE['ENV_GOBACK_URL']) ? "feedback_main.php" : $_COOKIE['ENV_GOBACK_URL']; | ||||
if (empty($dopost)) $dopost = ""; | if (empty($dopost)) $dopost = ""; | ||||
@@ -23,18 +22,18 @@ if ($dopost == 'edit') { | |||||
$adminmsg = str_replace(">", ">", $adminmsg); | $adminmsg = str_replace(">", ">", $adminmsg); | ||||
$adminmsg = str_replace(" ", " ", $adminmsg); | $adminmsg = str_replace(" ", " ", $adminmsg); | ||||
$adminmsg = str_replace("\r\n", "<br>\n", $adminmsg); | $adminmsg = str_replace("\r\n", "<br>\n", $adminmsg); | ||||
$msg = $msg."<br>\n"."<span class='text-danger'>".Lang('feedback_admin').":$adminmsg</span>\n"; | |||||
$msg = $msg."<br>\n"."<span class='text-danger'>管理员回复:$adminmsg</span>\n"; | |||||
} | } | ||||
$query = "UPDATE `#@__feedback` SET username='$username',msg='$msg',ischeck=1 WHERE id=$id"; | $query = "UPDATE `#@__feedback` SET username='$username',msg='$msg',ischeck=1 WHERE id=$id"; | ||||
$dsql->ExecuteNoneQuery($query); | $dsql->ExecuteNoneQuery($query); | ||||
ShowMsg(Lang("feedback_success_edit"), $ENV_GOBACK_URL); | |||||
ShowMsg("成功回复一则留言", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} elseif ($dopost === 'makehtml') { | } elseif ($dopost === 'makehtml') { | ||||
require_once(DEDEADMIN.'/inc/inc_archives_functions.php'); | require_once(DEDEADMIN.'/inc/inc_archives_functions.php'); | ||||
$query = "SELECT * FROM `#@__feedback` WHERE id=$id"; | $query = "SELECT * FROM `#@__feedback` WHERE id=$id"; | ||||
$row = $dsql->GetOne($query); | $row = $dsql->GetOne($query); | ||||
MakeArt($row['aid']); | MakeArt($row['aid']); | ||||
ShowMsg(Lang("feedback_success_makehtml"), $ENV_GOBACK_URL); | |||||
ShowMsg("成功更新评论所在的文档内容", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} | } | ||||
$query = "SELECT * FROM `#@__feedback` WHERE id=$id"; | $query = "SELECT * FROM `#@__feedback` WHERE id=$id"; | ||||
@@ -8,16 +8,15 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DataListCP; | |||||
use DedeBIZ\Login\UserLogin; | |||||
use DedeBIZ\TypeLink\TypeLink; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
//权限检查 | //权限检查 | ||||
UserLogin::CheckPurview('sys_Feedback'); | |||||
CheckPurview('sys_Feedback'); | |||||
require_once(DEDEINC."/datalistcp.class.php"); | |||||
require_once(DEDEINC."/typelink/typelink.class.php"); | |||||
setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/"); | setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/"); | ||||
function IsCheck($st) | function IsCheck($st) | ||||
{ | { | ||||
return $st == 1 ? "[".Lang('reviewed')."]" : "<span class='text-danger'>[".Lang('not_approved')."]</span>"; | |||||
return $st == 1 ? "[已审核]" : "<span class='text-danger'>[未审核]</span>"; | |||||
} | } | ||||
function jsTrimjajx($str, $len) | function jsTrimjajx($str, $len) | ||||
{ | { | ||||
@@ -32,7 +31,7 @@ function jsTrimjajx($str, $len) | |||||
if (!empty($job)) { | if (!empty($job)) { | ||||
$ids = preg_replace("#[^0-9,]#", '', $fid); | $ids = preg_replace("#[^0-9,]#", '', $fid); | ||||
if (empty($ids)) { | if (empty($ids)) { | ||||
ShowMsg(Lang('feedback_noselect'), $_COOKIE['ENV_GOBACK_URL'], 0, 500); | |||||
ShowMsg("您没选中任何选项", $_COOKIE['ENV_GOBACK_URL'], 0, 500); | |||||
exit; | exit; | ||||
} | } | ||||
} else { | } else { | ||||
@@ -49,28 +48,28 @@ function UpdateReplycount($id) | |||||
if ($job == 'del') { | if ($job == 'del') { | ||||
$query = "DELETE FROM `#@__feedback` WHERE id IN($ids) "; | $query = "DELETE FROM `#@__feedback` WHERE id IN($ids) "; | ||||
$dsql->ExecuteNoneQuery($query); | $dsql->ExecuteNoneQuery($query); | ||||
ShowMsg(Lang('feedback_success_delete'), $_COOKIE['ENV_GOBACK_URL'], 0, 500); | |||||
ShowMsg("成功删除指定的评论!", $_COOKIE['ENV_GOBACK_URL'], 0, 500); | |||||
exit(); | exit(); | ||||
} | } | ||||
//删除相同IP的所有评论 | //删除相同IP的所有评论 | ||||
else if ($job == 'delall') { | else if ($job == 'delall') { | ||||
$dsql->SetQuery("SELECT ip FROM `#@__feedback` WHERE id IN ($ids)"); | |||||
$dsql->SetQuery("SELECT ip FROM `#@__feedback` WHERE id IN ($ids) "); | |||||
$dsql->Execute(); | $dsql->Execute(); | ||||
$ips = ''; | $ips = ''; | ||||
while ($row = $dsql->GetArray()) { | while ($row = $dsql->GetArray()) { | ||||
$ips .= ($ips == '' ? " ip = '{$row['ip']}' " : " Or ip = '{$row['ip']}'"); | |||||
$ips .= ($ips == '' ? " ip = '{$row['ip']}' " : " Or ip = '{$row['ip']}' "); | |||||
} | } | ||||
if ($ips != '') { | if ($ips != '') { | ||||
$query = "DELETE FROM `#@__feedback` WHERE $ips "; | $query = "DELETE FROM `#@__feedback` WHERE $ips "; | ||||
$dsql->ExecuteNoneQuery($query); | $dsql->ExecuteNoneQuery($query); | ||||
} | } | ||||
ShowMsg(Lang('feedback_success_delete'), $_COOKIE['ENV_GOBACK_URL'], 0, 500); | |||||
ShowMsg("成功删除指定相同IP的所有评论!", $_COOKIE['ENV_GOBACK_URL'], 0, 500); | |||||
exit(); | exit(); | ||||
} | } | ||||
//审核评论 | //审核评论 | ||||
else if ($job == 'check') { | else if ($job == 'check') { | ||||
$query = "UPDATE `#@__feedback` SET ischeck=1 WHERE id IN($ids)"; | |||||
$query = "UPDATE `#@__feedback` SET ischeck=1 WHERE id IN($ids) "; | |||||
$dsql->ExecuteNoneQuery($query); | $dsql->ExecuteNoneQuery($query); | ||||
$dquery = "SELECT * FROM `#@__feedback` WHERE id IN($ids)"; | $dquery = "SELECT * FROM `#@__feedback` WHERE id IN($ids)"; | ||||
@@ -79,7 +78,7 @@ else if ($job == 'check') { | |||||
while ($row = $dsql->GetArray()) { | while ($row = $dsql->GetArray()) { | ||||
UpdateReplycount($row['fid']); | UpdateReplycount($row['fid']); | ||||
} | } | ||||
ShowMsg(Lang('feedback_success_check'), $_COOKIE['ENV_GOBACK_URL'], 0, 500); | |||||
ShowMsg("成功审核指定评论!", $_COOKIE['ENV_GOBACK_URL'], 0, 500); | |||||
exit(); | exit(); | ||||
} | } | ||||
//浏览评论 | //浏览评论 | ||||
@@ -1,4 +1,5 @@ | |||||
<?php | <?php | ||||
if (!defined('DEDEINC')) exit('dedebiz'); | |||||
/** | /** | ||||
* 文件管理逻辑类 | * 文件管理逻辑类 | ||||
* | * | ||||
@@ -12,7 +13,8 @@ class FileManagement | |||||
{ | { | ||||
var $baseDir = ""; | var $baseDir = ""; | ||||
var $activeDir = ""; | var $activeDir = ""; | ||||
//是否允许文件管理器删除目录,默认为不允许0,如果希望可能管理整个目录,请把值设为1 | |||||
//是否允许文件管理器删除目录; | |||||
//默认为不允许 0 ,如果希望可能管理整个目录,请把值设为 1 ; | |||||
var $allowDeleteDir = 0; | var $allowDeleteDir = 0; | ||||
//初始化系统 | //初始化系统 | ||||
function Init() | function Init() | ||||
@@ -28,9 +30,10 @@ class FileManagement | |||||
$newname = $this->baseDir.$this->activeDir."/".$newname; | $newname = $this->baseDir.$this->activeDir."/".$newname; | ||||
$oldext = pathinfo($oldname)['extension']; | $oldext = pathinfo($oldname)['extension']; | ||||
$newext = pathinfo($newname)['extension']; | $newext = pathinfo($newname)['extension']; | ||||
if ($oldext != $newext) { | if ($oldext != $newext) { | ||||
if (preg_match('#\.(php|pl|cgi|asp|aspx|jsp|php5|php4|php3|shtm|shtml)$#i', trim($newname))) { | if (preg_match('#\.(php|pl|cgi|asp|aspx|jsp|php5|php4|php3|shtm|shtml)$#i', trim($newname))) { | ||||
ShowMsg(Lang("media_ext_forbidden"), "javascript:;"); | |||||
ShowMsg("您指定的文件名被系统禁止", "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
} | } | ||||
@@ -38,7 +41,7 @@ class FileManagement | |||||
if (($newname != $oldname) && is_writable($oldname)) { | if (($newname != $oldname) && is_writable($oldname)) { | ||||
rename($oldname, $newname); | rename($oldname, $newname); | ||||
} | } | ||||
ShowMsg(Lang("file_success_rename"), "file_manage_main.php?activepath=".$this->activeDir); | |||||
ShowMsg("成功修改一个文件名", "file_manage_main.php?activepath=".$this->activeDir); | |||||
return 0; | return 0; | ||||
} | } | ||||
//创建新目录 | //创建新目录 | ||||
@@ -49,10 +52,10 @@ class FileManagement | |||||
if (is_writable($this->baseDir.$this->activeDir)) { | if (is_writable($this->baseDir.$this->activeDir)) { | ||||
MkdirAll($dirname, $GLOBALS['cfg_dir_purview']); | MkdirAll($dirname, $GLOBALS['cfg_dir_purview']); | ||||
CloseFtp(); | CloseFtp(); | ||||
ShowMsg(Lang("file_success_newdir"), "file_manage_main.php?activepath=".$this->activeDir."/".$newdir); | |||||
ShowMsg("成功创建一个新目录", "file_manage_main.php?activepath=".$this->activeDir."/".$newdir); | |||||
return 1; | return 1; | ||||
} else { | } else { | ||||
ShowMsg(Lang("file_err_newdir"), "file_manage_main.php?activepath=".$this->activeDir); | |||||
ShowMsg("创建新目录失败,因为这个位置不允许写入", "file_manage_main.php?activepath=".$this->activeDir); | |||||
return 0; | return 0; | ||||
} | } | ||||
} | } | ||||
@@ -83,14 +86,14 @@ class FileManagement | |||||
copy($oldfile, $truepath."/$mfile"); | copy($oldfile, $truepath."/$mfile"); | ||||
} | } | ||||
unlink($oldfile); | unlink($oldfile); | ||||
ShowMsg(Lang("file_success_move"), "file_manage_main.php?activepath=$mpath", 0, 1000); | |||||
ShowMsg("成功移动文件", "file_manage_main.php?activepath=$mpath", 0, 1000); | |||||
return 1; | return 1; | ||||
} else { | } else { | ||||
ShowMsg(Lang('file_err_move',array('oldfile'=>$oldfile,'truepath'=>$truepath,'mfile'=>$mfile)), "file_manage_main.php?activepath=$mpath", 0, 1000); | |||||
ShowMsg("移动文件 $oldfile > $truepath/$mfile 失败,可能是某个位置权限不足", "file_manage_main.php?activepath=$mpath", 0, 1000); | |||||
return 0; | return 0; | ||||
} | } | ||||
} else { | } else { | ||||
ShowMsg(Lang("file_err_path"), "-1", 0, 5000); | |||||
ShowMsg("对不起,您移动的路径不合法", "-1", 0, 5000); | |||||
return 0; | return 0; | ||||
} | } | ||||
} | } | ||||
@@ -99,7 +102,7 @@ class FileManagement | |||||
* | * | ||||
* @param unknown_type $indir | * @param unknown_type $indir | ||||
*/ | */ | ||||
function RmDirFiles($indir='') | |||||
function RmDirFiles($indir) | |||||
{ | { | ||||
if (!is_dir($indir)) { | if (!is_dir($indir)) { | ||||
return; | return; | ||||
@@ -124,7 +127,7 @@ class FileManagement | |||||
* @param unknown_type $fileexp | * @param unknown_type $fileexp | ||||
* @param unknown_type $filearr | * @param unknown_type $filearr | ||||
*/ | */ | ||||
function GetMatchFiles($indir='', $fileexp='', &$filearr) | |||||
function GetMatchFiles($indir, $fileexp, &$filearr) | |||||
{ | { | ||||
$dh = dir($indir); | $dh = dir($indir); | ||||
while ($filename = $dh->read()) { | while ($filename = $dh->read()) { | ||||
@@ -150,18 +153,18 @@ class FileManagement | |||||
$filename = $this->baseDir.$this->activeDir."/$filename"; | $filename = $this->baseDir.$this->activeDir."/$filename"; | ||||
if (is_file($filename)) { | if (is_file($filename)) { | ||||
@unlink($filename); | @unlink($filename); | ||||
$t = Lang("file"); | |||||
$t = "文件"; | |||||
} else { | } else { | ||||
$t = Lang("dir"); | |||||
$t = "目录"; | |||||
if ($this->allowDeleteDir == 1) { | if ($this->allowDeleteDir == 1) { | ||||
$this->RmDirFiles($filename); | $this->RmDirFiles($filename); | ||||
} else { | } else { | ||||
//完善用户体验,by:sumic | //完善用户体验,by:sumic | ||||
ShowMsg(Lang("file_err_delete").$t, "file_manage_main.php?activepath=".$this->activeDir); | |||||
ShowMsg("系统禁止删除".$t."", "file_manage_main.php?activepath=".$this->activeDir); | |||||
exit; | exit; | ||||
} | } | ||||
} | } | ||||
ShowMsg(Lang("file_success_delete").$t, "file_manage_main.php?activepath=".$this->activeDir); | |||||
ShowMsg("成功删除一个".$t."", "file_manage_main.php?activepath=".$this->activeDir); | |||||
return 0; | return 0; | ||||
} | } | ||||
} | } | ||||
@@ -8,41 +8,55 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DedeWin; | |||||
use DedeBIZ\Login\UserLogin; | |||||
require(dirname(__FILE__)."/config.php"); | require(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('plus_文件管理器'); | |||||
CheckPurview('plus_文件管理器'); | |||||
require(DEDEINC."/libraries/oxwindow.class.php"); | |||||
require_once(DEDEADMIN.'/file_class.php'); | require_once(DEDEADMIN.'/file_class.php'); | ||||
$activepath = str_replace("..", "", $activepath); | $activepath = str_replace("..", "", $activepath); | ||||
$activepath = preg_replace("#^\/{1,}#", "/", $activepath); | $activepath = preg_replace("#^\/{1,}#", "/", $activepath); | ||||
if ($activepath == "/") $activepath = ""; | if ($activepath == "/") $activepath = ""; | ||||
if ($activepath == "") $inpath = $cfg_basedir; | if ($activepath == "") $inpath = $cfg_basedir; | ||||
else $inpath = $cfg_basedir.$activepath; | else $inpath = $cfg_basedir.$activepath; | ||||
//显示控制层 | |||||
//文件管理器交互与逻辑控制文件 | |||||
$fmm = new FileManagement(); | $fmm = new FileManagement(); | ||||
$fmm->Init(); | $fmm->Init(); | ||||
/*--------------- | |||||
function __rename(); | |||||
----------------*/ | |||||
if ($fmdo == "rename") { | if ($fmdo == "rename") { | ||||
$fmm->RenameFile($oldfilename, $newfilename); | $fmm->RenameFile($oldfilename, $newfilename); | ||||
} | } | ||||
//新建目录 | //新建目录 | ||||
/*--------------- | |||||
function __newdir(); | |||||
----------------*/ | |||||
else if ($fmdo == "newdir") { | else if ($fmdo == "newdir") { | ||||
CheckCSRF(); | CheckCSRF(); | ||||
$fmm->NewDir($newpath); | $fmm->NewDir($newpath); | ||||
} | } | ||||
//移动文件 | //移动文件 | ||||
/*--------------- | |||||
function __move(); | |||||
----------------*/ | |||||
else if ($fmdo == "move") { | else if ($fmdo == "move") { | ||||
$fmm->MoveFile($filename, $newpath); | $fmm->MoveFile($filename, $newpath); | ||||
} | } | ||||
//删除文件 | //删除文件 | ||||
/*--------------- | |||||
function __delfile(); | |||||
----------------*/ | |||||
else if ($fmdo == "del") { | else if ($fmdo == "del") { | ||||
$fmm->DeleteFile($filename); | $fmm->DeleteFile($filename); | ||||
} | } | ||||
//文件编辑 | //文件编辑 | ||||
/*--------------- | |||||
function __saveEdit(); | |||||
----------------*/ | |||||
else if ($fmdo == "edit") { | else if ($fmdo == "edit") { | ||||
CheckCSRF(); | CheckCSRF(); | ||||
$filename = str_replace("..", "", $filename); | $filename = str_replace("..", "", $filename); | ||||
if (preg_match('#\.(php|pl|cgi|asp|aspx|jsp|php5|php4|php3|shtm|shtml)$#i', trim($filename))) { | if (preg_match('#\.(php|pl|cgi|asp|aspx|jsp|php5|php4|php3|shtm|shtml)$#i', trim($filename))) { | ||||
ShowMsg(Lang("media_ext_forbidden"), "javascript:;"); | |||||
ShowMsg("您指定的文件名被系统禁止", "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$file = "$cfg_basedir$activepath/$filename"; | $file = "$cfg_basedir$activepath/$filename"; | ||||
@@ -51,16 +65,16 @@ else if ($fmdo == "edit") { | |||||
fputs($fp, $str); | fputs($fp, $str); | ||||
fclose($fp); | fclose($fp); | ||||
if (empty($backurl)) { | if (empty($backurl)) { | ||||
ShowMsg(Lang("file_success_edit_one"), "file_manage_main.php?activepath=$activepath"); | |||||
ShowMsg("成功保存一个文件", "file_manage_main.php?activepath=$activepath"); | |||||
} else { | } else { | ||||
ShowMsg(Lang("file_success_edit"), $backurl); | |||||
ShowMsg("成功保存文件", $backurl); | |||||
} | } | ||||
exit(); | exit(); | ||||
} | } | ||||
/* | /* | ||||
文件编辑,可视化模式 | 文件编辑,可视化模式 | ||||
function __saveEditView(); | function __saveEditView(); | ||||
else if ($fmdo=="editview") | |||||
else if($fmdo=="editview") | |||||
{ | { | ||||
$filename = str_replace("..","",$filename); | $filename = str_replace("..","",$filename); | ||||
$file = "$cfg_basedir$activepath/$filename"; | $file = "$cfg_basedir$activepath/$filename"; | ||||
@@ -69,7 +83,7 @@ else if ($fmdo=="editview") | |||||
$fp = fopen($file,"w"); | $fp = fopen($file,"w"); | ||||
fputs($fp,$str); | fputs($fp,$str); | ||||
fclose($fp); | fclose($fp); | ||||
if (empty($backurl)) | |||||
if(empty($backurl)) | |||||
{ | { | ||||
$backurl = "file_manage_main.php?activepath=$activepath"; | $backurl = "file_manage_main.php?activepath=$activepath"; | ||||
} | } | ||||
@@ -78,6 +92,9 @@ else if ($fmdo=="editview") | |||||
} | } | ||||
*/ | */ | ||||
//文件上传 | //文件上传 | ||||
/*--------------- | |||||
function __upload(); | |||||
----------------*/ | |||||
else if ($fmdo == "upload") { | else if ($fmdo == "upload") { | ||||
$j = 0; | $j = 0; | ||||
for ($i = 1; $i <= 50; $i++) { | for ($i = 1; $i <= 50; $i++) { | ||||
@@ -92,11 +109,11 @@ else if ($fmdo == "upload") { | |||||
//检查文件类型 | //检查文件类型 | ||||
$mime = get_mime_type($upfile); | $mime = get_mime_type($upfile); | ||||
if (preg_match("#^unknow#", $mime)) { | if (preg_match("#^unknow#", $mime)) { | ||||
ShowMsg(Lang("media_no_fileinfo"), -1); | |||||
ShowMsg("系统不支持fileinfo组件,建议php.ini中开启", -1); | |||||
exit; | exit; | ||||
} | } | ||||
if (!preg_match("#^(image|video|audio|application)#i", $mime)) { | if (!preg_match("#^(image|video|audio|application)#i", $mime)) { | ||||
ShowMsg(Lang("media_only_media"), -1); | |||||
ShowMsg("仅支持媒体文件及应用程序上传", -1); | |||||
exit; | exit; | ||||
} | } | ||||
if (!file_exists($cfg_basedir.$activepath."/".$upfile_name)) { | if (!file_exists($cfg_basedir.$activepath."/".$upfile_name)) { | ||||
@@ -106,27 +123,30 @@ else if ($fmdo == "upload") { | |||||
$j++; | $j++; | ||||
} | } | ||||
} | } | ||||
ShowMsg(Lang('file_success_upload',array('j'=>$j,'activepath'=>$activepath)), "file_manage_main.php?activepath=$activepath"); | |||||
ShowMsg("成功上传 $j 个文件到: $activepath", "file_manage_main.php?activepath=$activepath"); | |||||
exit(); | exit(); | ||||
} | } | ||||
//空间检查 | //空间检查 | ||||
else if ($fmdo == "space") { | else if ($fmdo == "space") { | ||||
if ($activepath == "") { | if ($activepath == "") { | ||||
$ecpath = Lang("file_alldir"); | |||||
$ecpath = "所有目录"; | |||||
} else { | } else { | ||||
$ecpath = $activepath; | $ecpath = $activepath; | ||||
} | } | ||||
$titleinfo = Lang('dir')."[<a href='file_manage_main.php?activepath=$activepath'>$ecpath</a>]".Lang('file_spaceinfo').":<br>"; | |||||
$wintitle = Lang("file_manage"); | |||||
$wecome_info = Lang('file_manage')."::".Lang('file_sizecheck')." [<a href='file_manage_main.php?activepath=$activepath'>".Lang('file_manage')."</a>]</a>"; | |||||
$titleinfo = "目录[<a href='file_manage_main.php?activepath=$activepath'>$ecpath</a>]空间使用状况:<br>"; | |||||
$wintitle = "文件管理"; | |||||
$wecome_info = "文件管理::空间大小检查 [<a href='file_manage_main.php?activepath=$activepath'>文件浏览器</a>]</a>"; | |||||
$activepath = $cfg_basedir.$activepath; | $activepath = $cfg_basedir.$activepath; | ||||
$space = new SpaceUse; | $space = new SpaceUse; | ||||
$space->checksize($activepath); | $space->checksize($activepath); | ||||
$total = $space->totalsize; | $total = $space->totalsize; | ||||
$totalkb = $space->setkb($total); | $totalkb = $space->setkb($total); | ||||
$totalmb = $space->setmb($total); | $totalmb = $space->setmb($total); | ||||
DedeWin::Instance()->Init("", "js/blank.js", "POST")->AddTitle($titleinfo) | |||||
->AddMsgItem("$totalmb M<br>$totalkb KB<br>$total ".Lang('byte')) | |||||
->GetWindow("")->Display(); | |||||
$win = new OxWindow(); | |||||
$win->Init("", "js/blank.js", "POST"); | |||||
$win->AddTitle($titleinfo); | |||||
$win->AddMsgItem("$totalmb M<br>$totalkb KB<br>$total 字节"); | |||||
$winform = $win->GetWindow(""); | |||||
$win->Display(); | |||||
} | } | ||||
?> | ?> |
@@ -8,15 +8,14 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
require(dirname(__FILE__)."/config.php"); | require(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('plus_文件管理器'); | |||||
CheckPurview('plus_文件管理器'); | |||||
if (!isset($activepath)) $activepath = DEDEBIZ_SAFE_MODE? $cfg_medias_dir : $cfg_cmspath; | if (!isset($activepath)) $activepath = DEDEBIZ_SAFE_MODE? $cfg_medias_dir : $cfg_cmspath; | ||||
$inpath = ""; | $inpath = ""; | ||||
$activepath = str_replace("..", "", $activepath); | $activepath = str_replace("..", "", $activepath); | ||||
$activepath = preg_replace("#^\/{1,}#", "/", $activepath); | $activepath = preg_replace("#^\/{1,}#", "/", $activepath); | ||||
if (DEDEBIZ_SAFE_MODE && !preg_match("#^/static#",$activepath)) { | if (DEDEBIZ_SAFE_MODE && !preg_match("#^/static#",$activepath)) { | ||||
ShowMsg(Lang("file_safemode_static"), -1); | |||||
ShowMsg("安全模式下仅允许查看编辑static目录内容", -1); | |||||
exit; | exit; | ||||
} | } | ||||
if ($activepath == "/") $activepath = ""; | if ($activepath == "/") $activepath = ""; | ||||
@@ -8,74 +8,82 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DedeWin; | |||||
use DedeBIZ\Login\UserLogin; | |||||
use DedeBIZ\Template\DedeTagParse; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('plus_文件管理器'); | |||||
CheckPurview('plus_文件管理器'); | |||||
require_once(DEDEINC."/libraries/oxwindow.class.php"); | |||||
$activepath = str_replace("..", "", $activepath); | $activepath = str_replace("..", "", $activepath); | ||||
$activepath = preg_replace("#^\/{1,}#", "/", $activepath); | $activepath = preg_replace("#^\/{1,}#", "/", $activepath); | ||||
if ($activepath == "/") $activepath = ""; | if ($activepath == "/") $activepath = ""; | ||||
if ($activepath == "") $inpath = $cfg_basedir; | if ($activepath == "") $inpath = $cfg_basedir; | ||||
else $inpath = $cfg_basedir.$activepath; | else $inpath = $cfg_basedir.$activepath; | ||||
//显示控制层 | //显示控制层 | ||||
//修改文件名 | |||||
if ($fmdo == "rename") { | if ($fmdo == "rename") { | ||||
if ($activepath == "") $ndirstring = Lang("root_directory"); | |||||
if ($activepath == "") $ndirstring = "根目录"; | |||||
$ndirstring = $activepath; | $ndirstring = $activepath; | ||||
$wintitle = Lang("file_manage"); | |||||
$wecome_info = Lang("file_manage")."::".Lang('file_rename')." [<a href='file_manage_main.php?activepath=$activepath'>".Lang("file_manage")."</a>]</a>"; | |||||
DedeWin::Instance()->Init("file_manage_control.php", "js/blank.js", "POST") | |||||
->AddHidden("fmdo", $fmdo) | |||||
->AddHidden("activepath", $activepath) | |||||
->AddHidden("filename", $filename) | |||||
->AddTitle(Lang("file_rename_title",array('ndirstring'=>$ndirstring))) | |||||
->AddItem(Lang("file_rename_oldname"), "<input name='oldfilename' type='input' id='oldfilename' size='40' value='$filename'>") | |||||
->AddItem(Lang("file_rename_newname"), "<input name='newfilename' type='input' size='40' id='newfilename'>") | |||||
->GetWindow("ok")->Display(); | |||||
$wintitle = "文件管理"; | |||||
$wecome_info = "文件管理::修改文件名 [<a href='file_manage_main.php?activepath=$activepath'>文件浏览器</a>]</a>"; | |||||
$win = new OxWindow(); | |||||
$win->Init("file_manage_control.php", "js/blank.js", "POST"); | |||||
$win->AddHidden("fmdo", $fmdo); | |||||
$win->AddHidden("activepath", $activepath); | |||||
$win->AddHidden("filename", $filename); | |||||
$win->AddTitle("修改文件名,当前路径:$ndirstring"); | |||||
$win->AddItem("旧名称:", "<input name='oldfilename' type='input' id='oldfilename' size='40' value='$filename'>"); | |||||
$win->AddItem("新名称:", "<input name='newfilename' type='input' size='40' id='newfilename'>"); | |||||
$winform = $win->GetWindow("ok"); | |||||
$win->Display(); | |||||
} | } | ||||
//新建目录 | //新建目录 | ||||
else if ($fmdo == "newdir") { | else if ($fmdo == "newdir") { | ||||
if ($activepath == "") $activepathname = Lang("root_directory"); | |||||
if ($activepath == "") $activepathname = "根目录"; | |||||
else $activepathname = $activepath; | else $activepathname = $activepath; | ||||
$wintitle = Lang("file_manage"); | |||||
$wecome_info = Lang("file_manage")."::".Lang('file_rename_newdir')." [<a href='file_manage_main.php?activepath=$activepath'>".Lang("file_manage")."</a>]</a>"; | |||||
DedeWin::Instance()->Init("file_manage_control.php", "js/blank.js", "POST") | |||||
->AddHidden("fmdo", $fmdo) | |||||
->AddHidden("activepath", $activepath) | |||||
->AddHidden("token", make_hash()) | |||||
->AddTitle(Lang("file_rename_newdir_title",array('activepathname'=>$activepathname))) | |||||
->AddItem(Lang('new_directory').":", "<input name='newpath' type='input' id='newpath'>") | |||||
->GetWindow("ok") | |||||
->Display(); | |||||
$wintitle = "文件管理"; | |||||
$wecome_info = "文件管理::新建目录 [<a href='file_manage_main.php?activepath=$activepath'>文件浏览器</a>]</a>"; | |||||
$win = new OxWindow(); | |||||
$win->Init("file_manage_control.php", "js/blank.js", "POST"); | |||||
$win->AddHidden("fmdo", $fmdo); | |||||
$win->AddHidden("activepath", $activepath); | |||||
$win->AddHidden("token", make_hash()); | |||||
$win->AddTitle("当前目录 $activepathname "); | |||||
$win->AddItem("新目录:", "<input name='newpath' type='input' id='newpath'>"); | |||||
$winform = $win->GetWindow("ok"); | |||||
$win->Display(); | |||||
} | } | ||||
//移动文件 | //移动文件 | ||||
else if ($fmdo == "move") { | else if ($fmdo == "move") { | ||||
$wintitle = Lang("file_manage"); | |||||
$wecome_info = Lang("file_manage")."::".Lang('file_rename_move')." [<a href='file_manage_main.php?activepath=$activepath'>".Lang("file_manage")."</a>]</a>"; | |||||
DedeWin::Instance()->Init("file_manage_control.php", "js/blank.js", "POST") | |||||
->AddHidden("fmdo", $fmdo) | |||||
->AddHidden("activepath", $activepath) | |||||
->AddHidden("filename", $filename) | |||||
->AddTitle(Lang("file_rename_move_title")) | |||||
->AddItem(Lang("file_rename_move_src"), $filename) | |||||
->AddItem(Lang("file_rename_move_curr"), $activepath) | |||||
->AddItem(Lang("file_rename_move_new"), "<input name='newpath' type='input' id='newpath' size='40'>") | |||||
->GetWindow("ok") | |||||
->Display(); | |||||
$wintitle = "文件管理"; | |||||
$wecome_info = "文件管理::移动文件 [<a href='file_manage_main.php?activepath=$activepath'>文件浏览器</a>]</a>"; | |||||
$win = new OxWindow(); | |||||
$win->Init("file_manage_control.php", "js/blank.js", "POST"); | |||||
$win->AddHidden("fmdo", $fmdo); | |||||
$win->AddHidden("activepath", $activepath); | |||||
$win->AddHidden("filename", $filename); | |||||
$win->AddTitle("新位置前面不加'/'表示相对于当前位置,加'/'表示相对于根目录"); | |||||
$win->AddItem("被移动文件:", $filename); | |||||
$win->AddItem("当前位置:", $activepath); | |||||
$win->AddItem("新位置:", "<input name='newpath' type='input' id='newpath' size='40'>"); | |||||
$winform = $win->GetWindow("ok"); | |||||
$win->Display(); | |||||
} | } | ||||
//删除文件 | //删除文件 | ||||
else if ($fmdo == "del") { | else if ($fmdo == "del") { | ||||
$wintitle = Lang("file_manage"); | |||||
$wecome_info = Lang("file_manage")."::".Lang('file_rename_del')." [<a href='file_manage_main.php?activepath=$activepath'>".Lang("file_manage")."</a>]</a>"; | |||||
$wmsg = Lang('content_delete_confirm',array('qstr'=>$filename)); | |||||
DedeWin::Instance()->Init("file_manage_control.php", "js/blank.js", "POST") | |||||
->AddHidden("fmdo", $fmdo) | |||||
->AddHidden("activepath", $activepath) | |||||
->AddHidden("filename", $filename) | |||||
->AddTitle(Lang("file_rename_del_title")) | |||||
->AddMsgItem($wmsg, "50") | |||||
->GetWindow("ok") | |||||
->Display(); | |||||
$wintitle = "文件管理"; | |||||
$wecome_info = "文件管理::删除文件 [<a href='file_manage_main.php?activepath=$activepath'>文件浏览器</a>]</a>"; | |||||
$win = new OxWindow(); | |||||
$win->Init("file_manage_control.php", "js/blank.js", "POST"); | |||||
$win->AddHidden("fmdo", $fmdo); | |||||
$win->AddHidden("activepath", $activepath); | |||||
$win->AddHidden("filename", $filename); | |||||
if (@is_dir($cfg_basedir.$activepath."/$filename")) { | |||||
$wmsg = "您确定要删除目录:$filename 吗"; | |||||
} else { | |||||
$wmsg = "您确定要删除文件:$filename 吗"; | |||||
} | |||||
$win->AddTitle("删除文件确认"); | |||||
$win->AddMsgItem($wmsg, "50"); | |||||
$winform = $win->GetWindow("ok"); | |||||
$win->Display(); | |||||
} | } | ||||
//编辑文件 | //编辑文件 | ||||
else if ($fmdo == "edit") { | else if ($fmdo == "edit") { | ||||
@@ -92,7 +100,7 @@ else if ($fmdo == "edit") { | |||||
fclose($fp); | fclose($fp); | ||||
$content = dede_htmlspecialchars($content); | $content = dede_htmlspecialchars($content); | ||||
} | } | ||||
$contentView = "<textarea name='str' id='str' style='width:98%;height:450px;background:#ffffff;'>$content</textarea>\r\n"; | |||||
$contentView = "<textarea name='str' id='str' style='width:98%;height:300px;background:#ffffff;'>$content</textarea>\r\n"; | |||||
$GLOBALS['filename'] = $filename; | $GLOBALS['filename'] = $filename; | ||||
$path_parts = pathinfo($filename); | $path_parts = pathinfo($filename); | ||||
if ($path_parts['extension'] == 'php') { | if ($path_parts['extension'] == 'php') { | ||||
@@ -8,10 +8,10 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('c_FreeList'); | |||||
CheckPurview('c_FreeList'); | |||||
if (empty($dopost)) { | if (empty($dopost)) { | ||||
require_once DEDEINC.'/typelink/typelink.class.php'; | |||||
include DedeInclude('templets/freelist_add.htm'); | include DedeInclude('templets/freelist_add.htm'); | ||||
exit(); | exit(); | ||||
} else if ($dopost == 'save') { | } else if ($dopost == 'save') { | ||||
@@ -21,7 +21,7 @@ if (empty($dopost)) { | |||||
$ntype = ''; | $ntype = ''; | ||||
$edtime = time(); | $edtime = time(); | ||||
if (empty($channel)) { | if (empty($channel)) { | ||||
showmsg(Lang('freelist_err_channel_isempty'), '-1'); | |||||
showmsg('频道类型不能为空', '-1'); | |||||
exit(); | exit(); | ||||
} | } | ||||
if (is_array($types)) { | if (is_array($types)) { | ||||
@@ -37,10 +37,9 @@ if (empty($dopost)) { | |||||
if (!empty($innertext)) $innertext = stripslashes($innertext); | if (!empty($innertext)) $innertext = stripslashes($innertext); | ||||
$listTag = "{dede:list $atts}$innertext{/dede:list}"; | $listTag = "{dede:list $atts}$innertext{/dede:list}"; | ||||
$listTag = addslashes($listTag); | $listTag = addslashes($listTag); | ||||
$inquery = "INSERT INTO `#@__freelist` (`title`,`namerule`,`listdir`,`defaultpage`,`nodefault`,`templet`,`edtime`, `maxpage`,`click`,`listtag`,`keywords`,`description`) VALUES ('$title','$namerule','$listdir','$defaultpage','$nodefault','$templet','$edtime', '$maxpage','0','$listTag','$keywords','$description'); | |||||
"; | |||||
$inquery = "INSERT INTO `#@__freelist` (`title`,`namerule` , `listdir`,`defaultpage`,`nodefault`,`templet`,`edtime`, `maxpage`,`click`,`listtag`,`keywords`,`description`) VALUES ('$title','$namerule','$listdir','$defaultpage','$nodefault','$templet','$edtime','$maxpage','0','$listTag','$keywords','$description');"; | |||||
$dsql->ExecuteNoneQuery($inquery); | $dsql->ExecuteNoneQuery($inquery); | ||||
ShowMsg(Lang("freelist_add_success"), "freelist_main.php"); | |||||
ShowMsg("成功增加一个自由列表", "freelist_main.php"); | |||||
exit(); | exit(); | ||||
} | } | ||||
?> | ?> |
@@ -8,11 +8,12 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Template\DedeTagParse; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
if (empty($dopost)) { | if (empty($dopost)) { | ||||
require_once DEDEINC.'/typelink/typelink.class.php'; | |||||
require_once DEDEINC.'/dedetag.class.php'; | |||||
$aid = isset($aid) && is_numeric($aid) ? $aid : 0; | $aid = isset($aid) && is_numeric($aid) ? $aid : 0; | ||||
$row = $dsql->GetOne("SELECT * FROM `#@__freelist` WHERE aid='$aid'"); | |||||
$row = $dsql->GetOne("Select * From `#@__freelist` where aid='$aid' "); | |||||
$dtp = new DedeTagParse(); | $dtp = new DedeTagParse(); | ||||
$dtp->SetNameSpace("dede", "{", "}"); | $dtp->SetNameSpace("dede", "{", "}"); | ||||
$dtp->LoadSource("--".$row['listtag']."--"); | $dtp->LoadSource("--".$row['listtag']."--"); | ||||
@@ -38,9 +39,9 @@ if (empty($dopost)) { | |||||
if (!empty($innertext)) $innertext = stripslashes($innertext); | if (!empty($innertext)) $innertext = stripslashes($innertext); | ||||
$listTag = "{dede:list $atts}$innertext{/dede:list}"; | $listTag = "{dede:list $atts}$innertext{/dede:list}"; | ||||
$listTag = addslashes($listTag); | $listTag = addslashes($listTag); | ||||
$inquery = "UPDATE `#@__freelist` set title='$title',namerule='$namerule',listdir='$listdir',defaultpage='$defaultpage',nodefault='$nodefault',templet='$templet',edtime='$edtime',`maxpage`='$maxpage',listtag='$listTag',keywords='$keywords',description='$description' WHERE aid='$aid';"; | |||||
$inquery = "UPDATE `#@__freelist` set title='$title',namerule='$namerule',listdir='$listdir', defaultpage='$defaultpage',nodefault='$nodefault',templet='$templet',edtime='$edtime',`maxpage`='$maxpage',listtag='$listTag',keywords='$keywords',description='$description' WHERE aid='$aid';"; | |||||
$dsql->ExecuteNoneQuery($inquery); | $dsql->ExecuteNoneQuery($inquery); | ||||
ShowMsg(Lang("freelist_edit_success"), "freelist_main.php"); | |||||
ShowMsg("成功修改一个自由列表", "freelist_main.php"); | |||||
exit(); | exit(); | ||||
} | } | ||||
?> | ?> |
@@ -8,16 +8,15 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('c_FreeList'); | |||||
require_once DEDEINC.'/channel/channelunit.func.php'; | |||||
CheckPurview('c_FreeList'); | |||||
require_once DEDEINC.'/channelunit.func.php'; | |||||
setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/"); | setcookie("ENV_GOBACK_URL",$dedeNowurl,time()+3600,"/"); | ||||
if (empty($pagesize)) $pagesize = 30; | |||||
if (empty($pageno)) $pageno = 1; | |||||
if (empty($dopost)) $dopost = ''; | |||||
if (empty($orderby)) $orderby = 'aid'; | |||||
if (empty($keyword)) | |||||
if(empty($pagesize)) $pagesize = 30; | |||||
if(empty($pageno)) $pageno = 1; | |||||
if(empty($dopost)) $dopost = ''; | |||||
if(empty($orderby)) $orderby = 'aid'; | |||||
if(empty($keyword)) | |||||
{ | { | ||||
$keyword = ''; | $keyword = ''; | ||||
$addget = ''; | $addget = ''; | ||||
@@ -27,25 +26,25 @@ if (empty($keyword)) | |||||
$addsql = " where title like '%$keyword%' "; | $addsql = " where title like '%$keyword%' "; | ||||
} | } | ||||
//重载列表 | //重载列表 | ||||
if ($dopost=='getlist') | |||||
if($dopost=='getlist') | |||||
{ | { | ||||
AjaxHead(); | AjaxHead(); | ||||
GetTagList($dsql,$pageno,$pagesize,$orderby); | GetTagList($dsql,$pageno,$pagesize,$orderby); | ||||
exit(); | exit(); | ||||
} | } | ||||
//删除字段 | //删除字段 | ||||
else if ($dopost=='del') | |||||
else if($dopost=='del') | |||||
{ | { | ||||
$aid = preg_replace("#[^0-9]#", "", $aid); | $aid = preg_replace("#[^0-9]#", "", $aid); | ||||
$dsql->ExecuteNoneQuery("DELETE FROM `#@__freelist` WHERE aid='$aid';"); | |||||
$dsql->ExecuteNoneQuery("DELETE FROM `#@__freelist` WHERE aid='$aid'; "); | |||||
AjaxHead(); | AjaxHead(); | ||||
GetTagList($dsql,$pageno,$pagesize,$orderby); | GetTagList($dsql,$pageno,$pagesize,$orderby); | ||||
exit(); | exit(); | ||||
} | } | ||||
//第一次进入这个页面 | //第一次进入这个页面 | ||||
if ($dopost=='') | |||||
if($dopost=='') | |||||
{ | { | ||||
$row = $dsql->GetOne("SELECT COUNT(*) AS dd FROM `#@__freelist` $addsql"); | |||||
$row = $dsql->GetOne("SELECT COUNT(*) AS dd FROM `#@__freelist` $addsql "); | |||||
$totalRow = $row['dd']; | $totalRow = $row['dd']; | ||||
include(DEDEADMIN."/templets/freelist_main.htm"); | include(DEDEADMIN."/templets/freelist_main.htm"); | ||||
} | } | ||||
@@ -61,39 +60,34 @@ function GetTagList($dsql,$pageno,$pagesize,$orderby='aid') | |||||
{ | { | ||||
global $cfg_phpurl,$addsql; | global $cfg_phpurl,$addsql; | ||||
$start = ($pageno-1) * $pagesize; | $start = ($pageno-1) * $pagesize; | ||||
$printhead ="<table width='98%' cellpadding='1' cellspacing='1' align='center' class='table maintable' style='margin-bottom:10px'> | |||||
<tr align='center' bgcolor='#f8fcf2'> | |||||
<td width='5%' class='tbsname'><a href='javascript:;' onclick=\"ReloadPage('aid')\">id</a></td> | |||||
<td width='20%' class='tbsname'>".Lang('title')."</td> | |||||
<td width='20%' class='tbsname'>".Lang('template')."</td> | |||||
<td width='5%' class='tbsname'><a href='javascript:;' onclick=\"ReloadPage('click')\">".Lang('click')."</a></td> | |||||
<td width='15%' class='tbsname'>".Lang('edtime')."</td> | |||||
<td class='tbsname'>".Lang('operation')."</td> | |||||
</tr>\r\n"; | |||||
$printhead =" | |||||
<tr align='center' bgcolor='#fbfce2'> | |||||
<td width='5%'><a href='javascript:;' onclick=\"ReloadPage('aid')\">id</a></td> | |||||
<td width='20%'>列表名称</td> | |||||
<td width='20%'>模板文件</td> | |||||
<td width='5%'><a href='javascript:;' onclick=\"ReloadPage('click')\">点击</a></td> | |||||
<td width='15%'>创建时间</td> | |||||
<td>管理</td> | |||||
</tr>\r\n"; | |||||
echo $printhead; | echo $printhead; | ||||
$dsql->SetQuery("SELECT aid,title,templet,click,edtime,namerule,listdir,defaultpage,nodefault FROM `#@__freelist` $addsql ORDER BY $orderby DESC LIMIT $start,$pagesize"); | |||||
$dsql->SetQuery("SELECT aid,title,templet,click,edtime,namerule,listdir,defaultpage,nodefault From `#@__freelist` $addsql order by $orderby desc limit $start,$pagesize "); | |||||
$dsql->Execute(); | $dsql->Execute(); | ||||
$i = 0; | |||||
while($row = $dsql->GetArray()) | while($row = $dsql->GetArray()) | ||||
{ | { | ||||
$listurl = GetFreeListUrl($row['aid'],$row['namerule'],$row['listdir'],$row['defaultpage'],$row['nodefault']); | $listurl = GetFreeListUrl($row['aid'],$row['namerule'],$row['listdir'],$row['defaultpage'],$row['nodefault']); | ||||
$line = "<tr align='center' onMouseMove=\"javascript:this.bgColor='#f8fcf2';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\"> | |||||
$line = "<tr align='center' onMouseMove=\"javascript:this.bgColor='#fbfce2';\" onMouseOut=\"javascript:this.bgColor='#ffffff';\"> | |||||
<td>{$row['aid']}</td> | <td>{$row['aid']}</td> | ||||
<td> <a href='$listurl' target='_blank'>{$row['title']}</a> </td> | <td> <a href='$listurl' target='_blank'>{$row['title']}</a> </td> | ||||
<td> {$row['templet']} </td> | <td> {$row['templet']} </td> | ||||
<td> {$row['click']} </td> | <td> {$row['click']} </td> | ||||
<td>".MyDate("y-m-d",$row['edtime'])."</td> | <td>".MyDate("y-m-d",$row['edtime'])."</td> | ||||
<td> <a href='javascript:;' onclick='EditNote({$row['aid']})' class='btn btn-success btn-sm'><i class=\"fa fa-code\" aria-hidden=\"true\"></i> ".Lang("edit")."</a> | |||||
<a href='javascript:;' onclick='CreateNote({$row['aid']})' class='btn btn-success btn-sm'><i class=\"fa fa-refresh\" aria-hidden=\"true\"></i> ".Lang("update")."</a> | |||||
<a href='javascript:;' onclick='DelNote({$row['aid']})' class='btn btn-success btn-sm'><i class=\"fa fa-trash\" aria-hidden=\"true\"></i> ".Lang("delete")."</a> | |||||
</td> | |||||
</tr>"; | |||||
$i++; | |||||
<td> | |||||
<a href='javascript:;' onclick='EditNote({$row['aid']})' class='btn btn-success btn-sm'><i class=\"fa fa-pencil-square-o\" aria-hidden=\"true\"></i> 修改</a> | |||||
<a href='javascript:;' onclick='CreateNote({$row['aid']})' class='btn btn-success btn-sm'><i class=\"fa fa-refresh\" aria-hidden=\"true\"></i> 更新</a> | |||||
<a href='javascript:;' onclick='DelNote({$row['aid']})' class='btn btn-success btn-sm'><i class=\"fa fa-trash\" aria-hidden=\"true\"></i> 删除</a> | |||||
</td> | |||||
</tr>"; | |||||
echo $line; | echo $line; | ||||
} | } | ||||
if ($i == 0) { | |||||
echo "<tr><td colspan='6'><center>".Lang('none_result')."</center></td></tr>"; | |||||
} | |||||
echo "</table>\r\n"; | |||||
} | } | ||||
?> | ?> |
@@ -8,14 +8,13 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
require(dirname(__FILE__)."/config.php"); | require(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('plus_友情链接模块'); | |||||
CheckPurview('plus_友情链接模块'); | |||||
if (empty($dopost)) $dopost = ""; | if (empty($dopost)) $dopost = ""; | ||||
if ($dopost == "add") { | if ($dopost == "add") { | ||||
$dtime = time(); | $dtime = time(); | ||||
if (is_uploaded_file($logoimg)) { | if (is_uploaded_file($logoimg)) { | ||||
$names = explode(".", $logoimg_name); | |||||
$names = split("\.", $logoimg_name); | |||||
$shortname = ".".$names[count($names) - 1]; | $shortname = ".".$names[count($names) - 1]; | ||||
if (!preg_match("#(jpg|gif|png)$#", $shortname)) { | if (!preg_match("#(jpg|gif|png)$#", $shortname)) { | ||||
$shortname = '.gif'; | $shortname = '.gif'; | ||||
@@ -29,14 +28,14 @@ if ($dopost == "add") { | |||||
$imgurl = $imgurl."/".$filename; | $imgurl = $imgurl."/".$filename; | ||||
$mime = get_mime_type($logoimg); | $mime = get_mime_type($logoimg); | ||||
if (preg_match("#^unknow#", $mime)) { | if (preg_match("#^unknow#", $mime)) { | ||||
ShowMsg(Lang("media_no_fileinfo"), -1); | |||||
ShowMsg("系统不支持fileinfo组件,建议php.ini中开启", -1); | |||||
exit; | exit; | ||||
} | } | ||||
if (!preg_match("#^image#i", $mime)) { | if (!preg_match("#^image#i", $mime)) { | ||||
ShowMsg(Lang("media_only_image"), -1); | |||||
ShowMsg("非图片格式文件,无法正常上传", -1); | |||||
exit; | exit; | ||||
} | } | ||||
move_uploaded_file($logoimg, $cfg_basedir.$imgurl) or die(Lang('file_err_copy',array('path'=>$cfg_basedir.$imgurl))); | |||||
move_uploaded_file($logoimg, $cfg_basedir.$imgurl) or die("复制文件到:".$cfg_basedir.$imgurl."失败"); | |||||
@unlink($logoimg); | @unlink($logoimg); | ||||
} else { | } else { | ||||
$imgurl = $logo; | $imgurl = $logo; | ||||
@@ -44,7 +43,7 @@ if ($dopost == "add") { | |||||
//强制检测用户友情链接分类是否数据结构不符 | //强制检测用户友情链接分类是否数据结构不符 | ||||
if (empty($typeid) || preg_match("#[^0-9]#", $typeid)) { | if (empty($typeid) || preg_match("#[^0-9]#", $typeid)) { | ||||
$typeid = 0; | $typeid = 0; | ||||
$dsql->ExecuteNoneQuery("ALTER TABLE `#@__flinktype` CHANGE `ID` `id` MEDIUMINT( 8 ) UNSIGNED DEFAULT NULL AUTO_INCREMENT;"); | |||||
$dsql->ExecuteNoneQuery("ALTER TABLE `#@__flinktype` CHANGE `ID` `id` MEDIUMINT( 8 ) UNSIGNED DEFAULT NULL AUTO_INCREMENT; "); | |||||
} | } | ||||
$sortrank = isset($sortrank)? intval($sortrank) : 1; | $sortrank = isset($sortrank)? intval($sortrank) : 1; | ||||
$url = isset($url)? HtmlReplace($url, -1) : ''; | $url = isset($url)? HtmlReplace($url, -1) : ''; | ||||
@@ -54,14 +53,14 @@ if ($dopost == "add") { | |||||
$email = isset($email)? HtmlReplace($email, -1) : ''; | $email = isset($email)? HtmlReplace($email, -1) : ''; | ||||
$typeid = isset($typeid)? intval($typeid) : 0; | $typeid = isset($typeid)? intval($typeid) : 0; | ||||
$ischeck = isset($ischeck)? intval($ischeck) : 0; | $ischeck = isset($ischeck)? intval($ischeck) : 0; | ||||
$query = "INSERT INTO `#@__flink`(sortrank,url,webname,logo,msg,email,typeid,dtime,ischeck) VALUES ('$sortrank','$url','$webname','$imgurl','$msg','$email','$typeid','$dtime','$ischeck');"; | |||||
$query = "INSERT INTO `#@__flink` (sortrank,url,webname,logo,msg,email,typeid,dtime,ischeck) VALUES ('$sortrank','$url','$webname','$imgurl','$msg','$email','$typeid','$dtime','$ischeck'); "; | |||||
$rs = $dsql->ExecuteNoneQuery($query); | $rs = $dsql->ExecuteNoneQuery($query); | ||||
$burl = empty($_COOKIE['ENV_GOBACK_URL']) ? "friendlink_main.php" : $_COOKIE['ENV_GOBACK_URL']; | $burl = empty($_COOKIE['ENV_GOBACK_URL']) ? "friendlink_main.php" : $_COOKIE['ENV_GOBACK_URL']; | ||||
if ($rs) { | if ($rs) { | ||||
ShowMsg(Lang("friendlink_success_add"), $burl, 0, 500); | |||||
ShowMsg("成功增加一个链接", $burl, 0, 500); | |||||
exit(); | exit(); | ||||
} else { | } else { | ||||
ShowMsg(Lang('friendlink_err_add',array('err'=>$dsql->GetError())), "javascript:;"); | |||||
ShowMsg("增加链接时出错,请向官方反馈,原因:".$dsql->GetError(), "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
} | } | ||||
@@ -8,9 +8,8 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('plus_友情链接模块'); | |||||
CheckPurview('plus_友情链接模块'); | |||||
$ENV_GOBACK_URL = empty($_COOKIE['ENV_GOBACK_URL']) ? 'friendlink_main.php' : $_COOKIE['ENV_GOBACK_URL']; | $ENV_GOBACK_URL = empty($_COOKIE['ENV_GOBACK_URL']) ? 'friendlink_main.php' : $_COOKIE['ENV_GOBACK_URL']; | ||||
if (empty($dopost)) $dopost = ""; | if (empty($dopost)) $dopost = ""; | ||||
$id = isset($id)? intval($id) : 0; | $id = isset($id)? intval($id) : 0; | ||||
@@ -23,7 +22,7 @@ if (isset($allid)) { | |||||
} | } | ||||
if ($dopost == "delete") { | if ($dopost == "delete") { | ||||
$dsql->ExecuteNoneQuery("DELETE FROM `#@__flink` WHERE id='$id'"); | $dsql->ExecuteNoneQuery("DELETE FROM `#@__flink` WHERE id='$id'"); | ||||
ShowMsg(Lang("friendlink_success_delete"), $ENV_GOBACK_URL); | |||||
ShowMsg("成功删除一个链接", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} else if ($dopost == "delall") { | } else if ($dopost == "delall") { | ||||
$aids = explode(',', $aids); | $aids = explode(',', $aids); | ||||
@@ -32,10 +31,10 @@ if ($dopost == "delete") { | |||||
$aid = intval($aid); | $aid = intval($aid); | ||||
$dsql->ExecuteNoneQuery("DELETE FROM `#@__flink` WHERE id='$aid'"); | $dsql->ExecuteNoneQuery("DELETE FROM `#@__flink` WHERE id='$aid'"); | ||||
} | } | ||||
ShowMsg(Lang("content_delete_success"), $ENV_GOBACK_URL); | |||||
ShowMsg("成功删除指定链接", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} else { | } else { | ||||
ShowMsg(Lang("friendlink_select_none"), $ENV_GOBACK_URL); | |||||
ShowMsg("您没选定任何链接", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} | } | ||||
} else if ($dopost == "saveedit") { | } else if ($dopost == "saveedit") { | ||||
@@ -45,21 +44,21 @@ if ($dopost == "delete") { | |||||
} | } | ||||
if (!empty($logoimg)) { | if (!empty($logoimg)) { | ||||
if (!is_uploaded_file($logoimg)) { | if (!is_uploaded_file($logoimg)) { | ||||
ShowMsg(Lang("friendlink_err_imglogo_empty",array('file'=>$logoimg)), "-1"); | |||||
ShowMsg("您没有选择上传的文件".$logoimg, "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$mime = get_mime_type($logoimg); | $mime = get_mime_type($logoimg); | ||||
if (preg_match("#^unknow#", $mime)) { | if (preg_match("#^unknow#", $mime)) { | ||||
ShowMsg(Lang("media_no_fileinfo"), -1); | |||||
ShowMsg("系统不支持fileinfo组件,建议php.ini中开启", -1); | |||||
exit; | exit; | ||||
} | } | ||||
if (!preg_match("#^(image)#i", $mime)) { | if (!preg_match("#^(image)#i", $mime)) { | ||||
ShowMsg(Lang("media_only_image"), -1); | |||||
ShowMsg("仅支持上传图片文件", -1); | |||||
exit; | exit; | ||||
} | } | ||||
$logoimg_name = trim(preg_replace("#[ \r\n\t\*\%\\\/\?><\|\":]{1,}#", '', $logoimg_name)); | $logoimg_name = trim(preg_replace("#[ \r\n\t\*\%\\\/\?><\|\":]{1,}#", '', $logoimg_name)); | ||||
$fullfilename = DEDEROOT.'static/flink/'.$logoimg_name; | $fullfilename = DEDEROOT.'static/flink/'.$logoimg_name; | ||||
move_uploaded_file($logoimg, $fullfilename) or die(Lang('media_err_upload',array('filename'=>$fullfilename))); | |||||
move_uploaded_file($logoimg, $fullfilename) or die("上传文件到 $fullfilename 失败"); | |||||
@unlink($logoimg); | @unlink($logoimg); | ||||
$logo = $cfg_cmspath.'/static/flink/'.$logoimg_name; | $logo = $cfg_cmspath.'/static/flink/'.$logoimg_name; | ||||
} | } | ||||
@@ -70,9 +69,9 @@ if ($dopost == "delete") { | |||||
$email = isset($email)? HtmlReplace($email, -1) : ''; | $email = isset($email)? HtmlReplace($email, -1) : ''; | ||||
$typeid = isset($typeid)? intval($typeid) : 0; | $typeid = isset($typeid)? intval($typeid) : 0; | ||||
$ischeck = isset($ischeck)? intval($ischeck) : 0; | $ischeck = isset($ischeck)? intval($ischeck) : 0; | ||||
$query = "UPDATE `#@__flink` SET sortrank='$sortrank',url='$url',webname='$webname',logo='$logo',msg='$msg', email='$email',typeid='$typeid',ischeck='$ischeck' WHERE id='$id'"; | |||||
$query = "UPDATE `#@__flink` SET sortrank='$sortrank',url='$url',webname='$webname',logo='$logo',msg='$msg', email='$email',typeid='$typeid',ischeck='$ischeck' WHERE id='$id' "; | |||||
$dsql->ExecuteNoneQuery($query); | $dsql->ExecuteNoneQuery($query); | ||||
ShowMsg(Lang("friendlink_success_saveedit"), $ENV_GOBACK_URL); | |||||
ShowMsg("成功修改一个链接", $ENV_GOBACK_URL); | |||||
exit(); | exit(); | ||||
} | } | ||||
$myLink = $dsql->GetOne("SELECT `#@__flink`.*,`#@__flinktype`.typename FROM `#@__flink` LEFT JOIN `#@__flinktype` ON `#@__flink`.typeid=`#@__flinktype`.id WHERE `#@__flink`.id=$id"); | $myLink = $dsql->GetOne("SELECT `#@__flink`.*,`#@__flinktype`.typename FROM `#@__flink` LEFT JOIN `#@__flinktype` ON `#@__flink`.typeid=`#@__flinktype`.id WHERE `#@__flink`.id=$id"); | ||||
@@ -8,8 +8,8 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DataListCP; | |||||
require_once(dirname(__FILE__).'/config.php'); | require_once(dirname(__FILE__).'/config.php'); | ||||
require_once(DEDEINC.'/datalistcp.class.php'); | |||||
setcookie('ENV_GOBACK_URL', $dedeNowurl, time() + 3600, '/'); | setcookie('ENV_GOBACK_URL', $dedeNowurl, time() + 3600, '/'); | ||||
if (empty($keyword)) $keyword = ''; | if (empty($keyword)) $keyword = ''; | ||||
if (empty($ischeck)) { | if (empty($ischeck)) { | ||||
@@ -21,8 +21,8 @@ if (empty($ischeck)) { | |||||
else $ischeckSql = " And ischeck='$ischeck' "; | else $ischeckSql = " And ischeck='$ischeck' "; | ||||
} | } | ||||
$keyword = HtmlReplace($keyword, -1); | $keyword = HtmlReplace($keyword, -1); | ||||
$selCheckArr = array(0 => Lang('friendlink_ischeck_no'), -1 => Lang('friendlink_stat_0'), 1 => Lang('friendlink_ischeck_1'), 2 => Lang('friendlink_ischeck_2')); | |||||
$sql = "SELECT * FROM `#@__flink` WHERE CONCAT(`url`,`webname`,`email`) LIKE '%$keyword%' $ischeckSql ORDER BY dtime DESC"; | |||||
$selCheckArr = array(0 => '不限类型', -1 => '未审核', 1 => '内页', 2 => '首页'); | |||||
$sql = "SELECT * FROM `#@__flink` WHERE CONCAT(`url`,`webname`,`email`) LIKE '%$keyword%' $ischeckSql ORDER BY dtime desc"; | |||||
$dlist = new DataListCP(); | $dlist = new DataListCP(); | ||||
$dlist->SetParameter('keyword', $keyword); | $dlist->SetParameter('keyword', $keyword); | ||||
$dlist->SetParameter('ischeck', $ischeck); | $dlist->SetParameter('ischeck', $ischeck); | ||||
@@ -31,13 +31,13 @@ $dlist->SetSource($sql); | |||||
$dlist->display(); | $dlist->display(); | ||||
function GetPic($pic) | function GetPic($pic) | ||||
{ | { | ||||
if ($pic == '') return Lang('friendlink_nopic'); | |||||
if ($pic == '') return '无图标'; | |||||
else return "<img src='$pic' style='max-width:80px;max-height:60px'>"; | else return "<img src='$pic' style='max-width:80px;max-height:60px'>"; | ||||
} | } | ||||
function GetSta($sta) | function GetSta($sta) | ||||
{ | { | ||||
if ($sta == 1) return Lang('friendlink_stat_1'); | |||||
if ($sta == 2) return Lang('friendlink_stat_2'); | |||||
else return Lang('friendlink_stat_0'); | |||||
if ($sta == 1) return '内页'; | |||||
if ($sta == 2) return '首页'; | |||||
else return '未审核'; | |||||
} | } | ||||
?> | ?> |
@@ -20,22 +20,22 @@ if ($dopost == "save") { | |||||
$pname = HtmlReplace(${'pname_'.$startID},-1); | $pname = HtmlReplace(${'pname_'.$startID},-1); | ||||
if (isset(${'check_'.$startID})) { | if (isset(${'check_'.$startID})) { | ||||
if ($pname != '') { | if ($pname != '') { | ||||
$query = "UPDATE `#@__flinktype` SET typename='$pname' WHERE id='$tid'"; | |||||
$query = "UPDATE `#@__flinktype` SET typename='$pname' WHERE id='$tid' "; | |||||
$dsql->ExecuteNoneQuery($query); | $dsql->ExecuteNoneQuery($query); | ||||
} | } | ||||
} else { | } else { | ||||
$query = "DELETE FROM `#@__flinktype` WHERE id='$tid'"; | |||||
$query = "DELETE FROM `#@__flinktype` WHERE id='$tid' "; | |||||
$dsql->ExecuteNoneQuery($query); | $dsql->ExecuteNoneQuery($query); | ||||
} | } | ||||
} | } | ||||
//增加新记录 | //增加新记录 | ||||
if (isset($check_new) && $pname_new != '') { | if (isset($check_new) && $pname_new != '') { | ||||
$pname_new = HtmlReplace($pname_new, -1); | $pname_new = HtmlReplace($pname_new, -1); | ||||
$query = "INSERT INTO `#@__flinktype`(typename) VALUES ('{$pname_new}');"; | |||||
$query = "INSERT INTO `#@__flinktype` (typename) VALUES ('{$pname_new}');"; | |||||
$dsql->ExecuteNoneQuery($query); | $dsql->ExecuteNoneQuery($query); | ||||
} | } | ||||
header("Content-Type: text/html; charset=utf-8"); | |||||
echo "<script> alert('".Lang('friendlink_success_updatetype')."'); </script>"; | |||||
header("Content-Type: text/html; charset={$cfg_soft_lang}"); | |||||
echo "<script> alert('成功更新友情链接网站分类表'); </script>"; | |||||
} | } | ||||
include DedeInclude('templets/friendlink_type.htm'); | include DedeInclude('templets/friendlink_type.htm'); | ||||
?> | ?> |
@@ -1,7 +1,7 @@ | |||||
1,config_tab_site | |||||
2,config_tab_core | |||||
3,config_tab_addon | |||||
4,config_tab_user | |||||
5,config_tab_interaction | |||||
6,config_tab_performance | |||||
7,config_tab_other | |||||
1,站点设置 | |||||
2,核心设置 | |||||
3,附件设置 | |||||
4,会员设置 | |||||
5,互动设置 | |||||
6,性能选项 | |||||
7,其它选项 |
@@ -1,88 +1,88 @@ | |||||
>>gl_spec | |||||
>>特别权限(仅超级管理员使用) | |||||
>admin_AllowAll>gl_admin_AllowAll | |||||
>admin_AllowAll>可以进行任意操作 | |||||
>>gl_channel | |||||
>>频道管理 | |||||
>c_List>gl_c_List | |||||
>c_New>gl_c_New | |||||
>c_Edit>gl_c_Edit | |||||
>c_Del>gl_c_Del | |||||
>c_Stepselect>gl_c_Stepselect | |||||
>c_List>列出频道 | |||||
>c_New>新建频道 | |||||
>c_Edit>修改频道 | |||||
>c_Del>删除频道 | |||||
>c_Stepselect>联动类别管理 | |||||
>>gl_typename | |||||
>>栏目管理 | |||||
>t_List>gl_t_List | |||||
>t_New>gl_t_New | |||||
>t_Edit>gl_t_Edit | |||||
>t_Move>gl_t_Move | |||||
>t_Del>gl_t_Del | |||||
>t_AccList>gl_t_AccList | |||||
>t_AccNew>gl_t_AccNew | |||||
>t_AccEdit>gl_t_AccEdit | |||||
>t_AccDel>gl_t_AccDel | |||||
>t_List>列出任意栏目 | |||||
>t_New>新建任意栏目 | |||||
>t_Edit>修改任意栏目 | |||||
>t_Move>移动任意栏目 | |||||
>t_Del>删除任意栏目 | |||||
>t_AccList>列出授权栏目 | |||||
>t_AccNew>新建授权子栏目 | |||||
>t_AccEdit>修改授权子栏目 | |||||
>t_AccDel>删除授权子栏目 | |||||
>>gl_content | |||||
>>内容管理 | |||||
>a_List>gl_a_List | |||||
>a_New>gl_a_New | |||||
>a_Edit>gl_a_Edit | |||||
>a_Del>gl_a_Del | |||||
>a_Commend>gl_a_Commend | |||||
>a_Check>gl_a_Check | |||||
>a_AccNew>gl_a_AccNew | |||||
>a_AccList>gl_a_AccList | |||||
>a_AccEdit>gl_a_AccEdit | |||||
>a_AccDel>gl_a_AccDel | |||||
>a_AccCheck>gl_a_AccCheck | |||||
>a_MyList>gl_a_MyList | |||||
>a_MyEdit>gl_a_MyEdit | |||||
>a_MyDel>gl_a_MyDel | |||||
>a_MyCheck>gl_a_MyCheck | |||||
>a_Recycling>gl_a_Recycling | |||||
>a_List>列出内容 | |||||
>a_New>发布任意文档 | |||||
>a_Edit>修改任意文档 | |||||
>a_Del>删除任意文档 | |||||
>a_Commend>推荐任意文档 | |||||
>a_Check>审核任意文档 | |||||
>a_AccNew>发布授权文档 | |||||
>a_AccList>列出授权文档 | |||||
>a_AccEdit>修改授权文档 | |||||
>a_AccDel>删除授权文档 | |||||
>a_AccCheck>审核授权文档 | |||||
>a_MyList>列出我发布的文档 | |||||
>a_MyEdit>修改我发布的文档 | |||||
>a_MyDel>删除我发布的文档 | |||||
>a_MyCheck>审核我发布的文档 | |||||
>a_Recycling>管理回收站 | |||||
>>gl_template>unsafe | |||||
>>模板管理>unsafe | |||||
>temp_All>gl_temp_All>unsafe | |||||
>temp_New>gl_temp_New>unsafe | |||||
>temp_Edit>gl_temp_Edit>unsafe | |||||
>temp_Del>gl_temp_Del>unsafe | |||||
>temp_One>gl_temp_One>unsafe | |||||
>temp_MyTag>gl_temp_MyTag>unsafe | |||||
>temp_Test>gl_temp_Test>unsafe | |||||
>temp_Other>gl_temp_Other>unsafe | |||||
>temp_All>管理所有模板>unsafe | |||||
>temp_New>新建模板>unsafe | |||||
>temp_Edit>修改模板>unsafe | |||||
>temp_Del>删除模板>unsafe | |||||
>temp_One>单页模板管理>unsafe | |||||
>temp_MyTag>自定义标记>unsafe | |||||
>temp_Test>测试标记>unsafe | |||||
>temp_Other>模板其它管理>unsafe | |||||
>>gl_special | |||||
>>专题管理 | |||||
>spec_New>gl_spec_New | |||||
>spec_List>gl_spec_List | |||||
>spec_Edit>gl_spec_Edit | |||||
>spec_New>新建专题 | |||||
>spec_List>列出专题 | |||||
>spec_Edit>修改专题 | |||||
>>gl_system | |||||
>>系统管理权限 | |||||
>sys_User>gl_sys_User | |||||
>sys_Group>gl_sys_Group | |||||
>sys_MdPwd>gl_sys_MdPwd | |||||
>sys_DelUpload>gl_sys_DelUpload | |||||
>sys_Edit>gl_sys_Edit | |||||
>sys_Log>gl_sys_Log | |||||
>sys_plus>gl_sys_plus | |||||
>sys_Data>gl_sys_Data>unsafe | |||||
>sys_Att>gl_sys_Att | |||||
>sys_ArcBatch>gl_sys_ArcBatch | |||||
>sys_ArcTj>gl_sys_ArcTj | |||||
>sys_Source>gl_sys_Source | |||||
>sys_Writer>gl_sys_Writer | |||||
>sys_SoftConfig>gl_sys_SoftConfig | |||||
>sys_Keyword>gl_sys_Keyword | |||||
>sys_MakeHtml>gl_sys_MakeHtml | |||||
>sys_Feedback>gl_sys_Feedback | |||||
>sys_Upload>gl_sys_Upload | |||||
>sys_MyUpload>gl_sys_MyUpload | |||||
>sys_User>系统用户管理 | |||||
>sys_Group>系统组管理 | |||||
>sys_MdPwd>修改个人密码 | |||||
>sys_DelUpload>删除附件 | |||||
>sys_Edit>修改系统参数 | |||||
>sys_Log>管理日志 | |||||
>sys_plus>插件管理 | |||||
>sys_Data>数据备份还原>unsafe | |||||
>sys_Att>自定义文档属性 | |||||
>sys_ArcBatch>文档批量维护 | |||||
>sys_ArcTj>文档信息统计 | |||||
>sys_Source>新闻来源 | |||||
>sys_Writer>作者管理 | |||||
>sys_SoftConfig>软件频道参数 | |||||
>sys_Keyword>关键词管理 | |||||
>sys_MakeHtml>更新HTML | |||||
>sys_Feedback>评论管理 | |||||
>sys_Upload>管理任意上传 | |||||
>sys_MyUpload>管理我的上传 | |||||
>>gl_user | |||||
>>会员管理 | |||||
>member_Type>gl_member_Type | |||||
>member_List>gl_member_List | |||||
>member_Edit>gl_member_Edit | |||||
>member_Del>gl_member_Del | |||||
>member_Type>会员类型管理 | |||||
>member_List>列出会员 | |||||
>member_Edit>修改会员 | |||||
>member_Del>删除会员 |
@@ -2,417 +2,428 @@ | |||||
/** | /** | ||||
* 后台操作记录信息 | * 后台操作记录信息 | ||||
* | * | ||||
* @version $Id: inc_action_info.php 2022-07-01 tianya $ | |||||
* @version $Id: inc_action_info.php 2 14:55 2010-11-11 tianya $ | |||||
* @package DedeBIZ.Administrator | * @package DedeBIZ.Administrator | ||||
* @copyright Copyright (c) 2022, DedeBIZ.COM | * @copyright Copyright (c) 2022, DedeBIZ.COM | ||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/../config.php"); | require_once(dirname(__FILE__)."/../config.php"); | ||||
$cUserLogin = new UserLogin(); | |||||
$cuserLogin = new userLogin(); | |||||
//后台功能操作配置项 | //后台功能操作配置项 | ||||
$actionSearch[0] = array( | $actionSearch[0] = array( | ||||
'toptitle' => Lang('manage'), | |||||
'title' => Lang('normal_actions'), | |||||
'description' => Lang('normal_actions_desc'), | |||||
'toptitle' => '运维', | |||||
'title' => '常规操作', | |||||
'description' => '站点档案常规功能操作', | |||||
'soniterm' => array( | 'soniterm' => array( | ||||
0 => array( | 0 => array( | ||||
'title' => Lang('site_catalog_main'), | |||||
'description' => Lang('site_catalog_main_desc'), | |||||
'title' => '网站栏目管理', | |||||
'description' => '站点所有栏目管理', | |||||
'purview' => 't_List,t_AccList', | 'purview' => 't_List,t_AccList', | ||||
'linkurl' => 'catalog_main.php' | 'linkurl' => 'catalog_main.php' | ||||
), | ), | ||||
1 => array( | 1 => array( | ||||
'title' => Lang('content_list_-1'), | |||||
'description' => Lang('content_list_-1_desc'), | |||||
'title' => '等审核的档案', | |||||
'description' => '所有内容模型发表的未经审核内容列表', | |||||
'purview' => 'a_Check,a_AccCheck', | 'purview' => 'a_Check,a_AccCheck', | ||||
'linkurl' => 'content_list.php?arcrank=-1' | 'linkurl' => 'content_list.php?arcrank=-1' | ||||
), | ), | ||||
2 => array( | 2 => array( | ||||
'title' => Lang('content_list_me'), | |||||
'description' => Lang('content_list_me_desc'), | |||||
'title' => '我发布的文档', | |||||
'description' => '现在登录的管理员所发表的所有内容模型中的文档', | |||||
'purview' => 'a_List,a_AccList,a_MyList', | 'purview' => 'a_List,a_AccList,a_MyList', | ||||
'linkurl' => 'content_list.php?mid='.$cUserLogin->userID | |||||
'linkurl' => 'content_list.php?mid='.$cuserLogin->userID | |||||
), | ), | ||||
3 => array( | 3 => array( | ||||
'title' => Lang('feedback_main'), | |||||
'description' => Lang('feedback_main_desc'), | |||||
'title' => '评论管理', | |||||
'description' => '网站所有评论管理', | |||||
'purview' => 'sys_Feedback', | 'purview' => 'sys_Feedback', | ||||
'linkurl' => 'feedback_main.php' | 'linkurl' => 'feedback_main.php' | ||||
), | ), | ||||
4 => array( | 4 => array( | ||||
'title' => Lang('content_recycling'), | |||||
'description' => Lang('content_recycling_desc'), | |||||
'title' => '内容回收站', | |||||
'description' => '如果在"系统配置变量"的"核心设置"中开启了"文档回收站是否开启功能",后台删除的文档将会存放在此处', | |||||
'purview' => 'a_List,a_AccList,a_MyList', | 'purview' => 'a_List,a_AccList,a_MyList', | ||||
'linkurl' => 'recycling.php' | 'linkurl' => 'recycling.php' | ||||
) | ) | ||||
) | ) | ||||
); | ); | ||||
$actionSearch[1] = array( | $actionSearch[1] = array( | ||||
'toptitle' => Lang('manage'), | |||||
'title' => Lang('content_main'), | |||||
'description' => Lang('content_main_desc'), | |||||
'toptitle' => '运维', | |||||
'title' => '内容管理', | |||||
'description' => '网站对应内容模型的文档管理', | |||||
'soniterm' => array( | 'soniterm' => array( | ||||
0 => array( | 0 => array( | ||||
'title' => Lang('content_s_list'), | |||||
'description' => Lang('content_s_list_desc'), | |||||
'title' => '专题管理', | |||||
'description' => '所有专题内容的管理', | |||||
'purview' => 'spec_New', | 'purview' => 'spec_New', | ||||
'linkurl' => 'content_s_list.php' | 'linkurl' => 'content_s_list.php' | ||||
), | ), | ||||
) | ) | ||||
); | ); | ||||
$actionSearch[2] = array( | $actionSearch[2] = array( | ||||
'toptitle' => Lang('manage'), | |||||
'title' => Lang('attachment_main'), | |||||
'description' => Lang('attachment_main_desc'), | |||||
'toptitle' => '运维', | |||||
'title' => '附件管理', | |||||
'description' => '所有上传的附件管理', | |||||
'soniterm' => array( | 'soniterm' => array( | ||||
0 => array( | 0 => array( | ||||
'title' => Lang('media_add'), | |||||
'description' => Lang('media_add_desc'), | |||||
'title' => '上传新文件 ', | |||||
'description' => '通过这可以上传图片、FLASH、视频音频、附件其它等附件', | |||||
'purview' => '', | 'purview' => '', | ||||
'linkurl' => 'media_add.php' | 'linkurl' => 'media_add.php' | ||||
), | ), | ||||
1 => array( | 1 => array( | ||||
'title' => Lang('media_main'), | |||||
'description' => Lang('media_main_desc'), | |||||
'title' => '附件数据管理 ', | |||||
'description' => '列出所有上传的附件', | |||||
'purview' => 'sys_Upload,sys_MyUpload', | 'purview' => 'sys_Upload,sys_MyUpload', | ||||
'linkurl' => 'media_main.php' | 'linkurl' => 'media_main.php' | ||||
), | ), | ||||
2 => array( | 2 => array( | ||||
'title' => Lang('media_main_filemanager'), | |||||
'description' => Lang('media_main_filemanager_desc'), | |||||
'title' => '文件式管理器 ', | |||||
'description' => '应用文件浏览的模式进行附件的管理', | |||||
'purview' => 'plus_文件管理器', | 'purview' => 'plus_文件管理器', | ||||
'linkurl' => 'media_main.php?dopost=filemanager' | 'linkurl' => 'media_main.php?dopost=filemanager' | ||||
), | ), | ||||
) | ) | ||||
); | ); | ||||
$actionSearch[3] = array( | $actionSearch[3] = array( | ||||
'toptitle' => Lang('manage'), | |||||
'title' => Lang('mychannel'), | |||||
'description' => Lang('mychannel_desc'), | |||||
'toptitle' => '运维', | |||||
'title' => '频道模型', | |||||
'description' => '所有上传的附件管理', | |||||
'soniterm' => array( | 'soniterm' => array( | ||||
0 => array( | 0 => array( | ||||
'title' => Lang('mychannel_main'), | |||||
'description' => Lang('mychannel_main_desc'), | |||||
'title' => '内容模型管理 ', | |||||
'description' => '可以对现有商品、软件、图片集、普通文档、专题、分类信息等模型就行管理,也可以创建新的内容模型', | |||||
'purview' => 'c_List', | 'purview' => 'c_List', | ||||
'linkurl' => 'mychannel_main.php' | 'linkurl' => 'mychannel_main.php' | ||||
), | ), | ||||
1 => array( | 1 => array( | ||||
'title' => Lang('templets_one'), | |||||
'description' => Lang('templets_one_desc'), | |||||
'title' => '单页文档管理 ', | |||||
'description' => '创建和管理单页面', | |||||
'purview' => 'temp_One', | 'purview' => 'temp_One', | ||||
'linkurl' => 'templets_one.php' | 'linkurl' => 'templets_one.php' | ||||
), | ), | ||||
2 => array( | 2 => array( | ||||
'title' => Lang('stepselect_main'), | |||||
'description' => Lang('stepselect_main_desc'), | |||||
'title' => '联动类别管理 ', | |||||
'description' => '创建和管理所有的联动', | |||||
'purview' => 'c_Stepseclect', | 'purview' => 'c_Stepseclect', | ||||
'linkurl' => 'stepselect_main.php?dopost=filemanager' | 'linkurl' => 'stepselect_main.php?dopost=filemanager' | ||||
), | ), | ||||
3 => array( | 3 => array( | ||||
'title' => Lang('freelist_main'), | |||||
'description' => Lang('freelist_main_desc'), | |||||
'title' => '自由列表管理 ', | |||||
'description' => '创建不同的列表形式', | |||||
'purview' => 'c_List', | 'purview' => 'c_List', | ||||
'linkurl' => 'freelist_main.php' | 'linkurl' => 'freelist_main.php' | ||||
), | ), | ||||
4 => array( | 4 => array( | ||||
'title' => Lang('diy_main'), | |||||
'description' => Lang('diy_main_desc'), | |||||
'title' => '自定义表单 ', | |||||
'description' => '创建和管理自定义表单', | |||||
'purview' => 'c_List', | 'purview' => 'c_List', | ||||
'linkurl' => 'diy_main.php' | 'linkurl' => 'diy_main.php' | ||||
), | ), | ||||
) | ) | ||||
); | ); | ||||
$actionSearch[4] = array( | $actionSearch[4] = array( | ||||
'toptitle' => Lang('manage'), | |||||
'title' => Lang('batch_main'), | |||||
'description' => Lang('batch_main_desc'), | |||||
'toptitle' => '运维', | |||||
'title' => '批量维护', | |||||
'description' => '对一些东西进行批量的删除,添加等等', | |||||
'soniterm' => array( | 'soniterm' => array( | ||||
0 => array( | 0 => array( | ||||
'title' => Lang('sys_cache_up'), | |||||
'description' => Lang('sys_cache_up_desc'), | |||||
'title' => '更新系统缓存 ', | |||||
'description' => '更新栏目缓存、更新枚举缓存 、清理arclist调用缓存 、清理过期会员访问历史 、删除过期短信', | |||||
'purview' => 'sys_ArcBatch', | 'purview' => 'sys_ArcBatch', | ||||
'linkurl' => 'sys_cache_up.php' | 'linkurl' => 'sys_cache_up.php' | ||||
), | ), | ||||
1 => array( | 1 => array( | ||||
'title' => Lang('content_batch_up'), | |||||
'description' => Lang('content_batch_up_desc'), | |||||
'title' => '文档批量维护 ', | |||||
'description' => '批量的对某个栏目或者全部栏目的内容进行审核文档、更新HTML、移动文档、删除文档', | |||||
'purview' => 'sys_ArcBatch', | 'purview' => 'sys_ArcBatch', | ||||
'linkurl' => 'content_batch_up.php' | 'linkurl' => 'content_batch_up.php' | ||||
), | ), | ||||
2 => array( | 2 => array( | ||||
'title' => Lang('search_keywords_main'), | |||||
'description' => Lang('search_keywords_main_desc'), | |||||
'title' => '搜索关键词维护 ', | |||||
'description' => '对已经进行的所有所搜的关键词进行管理', | |||||
'purview' => 'sys_Keyword', | 'purview' => 'sys_Keyword', | ||||
'linkurl' => 'search_keywords_main.php?dopost=filemanager' | 'linkurl' => 'search_keywords_main.php?dopost=filemanager' | ||||
), | ), | ||||
3 => array( | 3 => array( | ||||
'title' => Lang('article_keywords_main'), | |||||
'description' => Lang('article_keywords_main_desc'), | |||||
'title' => '文档关键词维护 ', | |||||
'description' => '对文档中的关键词进行批量的维护', | |||||
'purview' => 'sys_Keyword', | 'purview' => 'sys_Keyword', | ||||
'linkurl' => 'article_keywords_main.php' | 'linkurl' => 'article_keywords_main.php' | ||||
), | ), | ||||
4 => array( | 4 => array( | ||||
'title' => Lang('article_test_same'), | |||||
'description' => Lang('article_test_same_desc'), | |||||
'title' => '重复文档检测 ', | |||||
'description' => '可以对网站中出现的重复标题的文档进行处理', | |||||
'purview' => 'sys_ArcBatch', | 'purview' => 'sys_ArcBatch', | ||||
'linkurl' => 'article_test_same.php' | 'linkurl' => 'article_test_same.php' | ||||
), | ), | ||||
5 => array( | 5 => array( | ||||
'title' => Lang('article_description_main'), | |||||
'description' => Lang('article_description_main_desc'), | |||||
'title' => '自动摘要|分页 ', | |||||
'description' => '用于自动更新您系统没有填写摘要的文档的摘要信息或更新没分页的文档的自动分页标识', | |||||
'purview' => 'sys_Keyword', | 'purview' => 'sys_Keyword', | ||||
'linkurl' => 'article_description_main.php' | 'linkurl' => 'article_description_main.php' | ||||
), | ), | ||||
6 => array( | 6 => array( | ||||
'title' => Lang('tags_main'), | |||||
'description' => Lang('tags_main_desc'), | |||||
'title' => 'Tag标签管理 ', | |||||
'description' => '对整个网站的tag进行批量的维护', | |||||
'purview' => 'sys_Keyword', | 'purview' => 'sys_Keyword', | ||||
'linkurl' => 'tags_main.php' | 'linkurl' => 'tags_main.php' | ||||
), | ), | ||||
7 => array( | 7 => array( | ||||
'title' => Lang('sys_data_replace'), | |||||
'description' => Lang('sys_data_replace_desc'), | |||||
'title' => '数据库内容替换 ', | |||||
'description' => '可以对数据库中的某张表中的字段进行内容的批量替换', | |||||
'purview' => 'sys_ArcBatch', | 'purview' => 'sys_ArcBatch', | ||||
'linkurl' => 'sys_data_replace.php' | 'linkurl' => 'sys_data_replace.php' | ||||
), | ), | ||||
) | ) | ||||
); | ); | ||||
$actionSearch[5] = array( | $actionSearch[5] = array( | ||||
'toptitle' => Lang('member'), | |||||
'title' => Lang('member_main2'), | |||||
'description' => Lang('member_main2_desc'), | |||||
'toptitle' => '会员', | |||||
'title' => '会员管理', | |||||
'description' => '注册会员及积分等配置管理', | |||||
'soniterm' => array( | 'soniterm' => array( | ||||
0 => array( | 0 => array( | ||||
'title' => Lang('member_main'), | |||||
'description' => Lang('member_main_desc'), | |||||
'title' => '注册会员列表', | |||||
'description' => '所有注册会员的管理项,其中包含修改删除,查看会员文档以及提升管理员等操作', | |||||
'purview' => 'member_List', | 'purview' => 'member_List', | ||||
'linkurl' => 'member_main.php' | 'linkurl' => 'member_main.php' | ||||
), | ), | ||||
1 => array( | 1 => array( | ||||
'title' => Lang('member_rank'), | |||||
'description' => Lang('member_rank_desc'), | |||||
'title' => '会员级别设置', | |||||
'description' => '设置会员的级别,可以通过设计不同会员的访问权限来对会员级别进行一个扩展', | |||||
'purview' => 'member_Type', | 'purview' => 'member_Type', | ||||
'linkurl' => 'member_rank.php' | 'linkurl' => 'member_rank.php' | ||||
), | ), | ||||
2 => array( | 2 => array( | ||||
'title' => Lang('member_scores'), | |||||
'description' => Lang('member_scores_desc'), | |||||
'title' => '积分头衔设置', | |||||
'description' => '会员积分等级设置,根据会员活动积分对会员进行头衔划分', | |||||
'purview' => 'member_Type', | 'purview' => 'member_Type', | ||||
'linkurl' => 'member_scores.php' | 'linkurl' => 'member_scores.php' | ||||
), | ), | ||||
4 => array( | 4 => array( | ||||
'title' => Lang('member_pm'), | |||||
'description' => Lang('member_pm_desc'), | |||||
'title' => '会员短信管理', | |||||
'description' => '会员之间发送的短消息管理,其中包含群发短消息和对单个会员发送短消息两种', | |||||
'purview' => 'member_Type', | 'purview' => 'member_Type', | ||||
'linkurl' => 'member_pm.php' | 'linkurl' => 'member_pm.php' | ||||
), | ), | ||||
) | ) | ||||
); | ); | ||||
$actionSearch[6] = array( | $actionSearch[6] = array( | ||||
'toptitle' => Lang('member'), | |||||
'title' => Lang('pay_tools'), | |||||
'description' => Lang('pay_tools_desc'), | |||||
'toptitle' => '会员', | |||||
'title' => '支付工具', | |||||
'description' => '站点财务相关设置,包含点卡,商店订单等操作', | |||||
'soniterm' => array( | 'soniterm' => array( | ||||
0 => array( | 0 => array( | ||||
'title' => Lang('cards_type'), | |||||
'description' => Lang('cards_type_desc'), | |||||
'title' => '点卡产品分类', | |||||
'description' => '网站点卡产品分类,可以添加不同点数的点卡产品类型', | |||||
'purview' => 'sys_Data', | 'purview' => 'sys_Data', | ||||
'linkurl' => 'cards_type.php' | 'linkurl' => 'cards_type.php' | ||||
), | ), | ||||
1 => array( | 1 => array( | ||||
'title' => Lang('cards_manage'), | |||||
'description' => Lang('cards_manage_desc'), | |||||
'title' => '点卡产品管理', | |||||
'description' => '管理网站点卡,可以在这里生成点卡以及查看点卡的当前状态', | |||||
'purview' => 'sys_Data', | 'purview' => 'sys_Data', | ||||
'linkurl' => 'cards_manage.php' | 'linkurl' => 'cards_manage.php' | ||||
), | ), | ||||
2 => array( | 2 => array( | ||||
'title' => Lang('member_type'), | |||||
'description' => Lang('member_type_desc'), | |||||
'title' => '会员产品分类', | |||||
'description' => '可以将会员类型进行产品划分,比如出售高级会员1年这种,在这里可以对会员产品进行定义', | |||||
'purview' => 'sys_Data', | 'purview' => 'sys_Data', | ||||
'linkurl' => 'member_type.php' | 'linkurl' => 'member_type.php' | ||||
), | ), | ||||
3 => array( | 3 => array( | ||||
'title' => Lang('member_operations'), | |||||
'description' => Lang('member_operations_desc'), | |||||
'title' => '会员消费记录', | |||||
'description' => '会员在前台进行操作、消费积分的消费记录,同时可以查看消费充值订单的付款情况', | |||||
'purview' => 'sys_Data', | 'purview' => 'sys_Data', | ||||
'linkurl' => 'member_operations.php' | 'linkurl' => 'member_operations.php' | ||||
), | ), | ||||
4 => array( | 4 => array( | ||||
'title' => Lang('shops_operations'), | |||||
'description' => Lang('shops_operations_desc'), | |||||
'title' => '商店订单记录', | |||||
'description' => '前台会员商店提交的订单记录,这里可以对这些订单进行一个统一的管理', | |||||
'purview' => 'sys_Data', | 'purview' => 'sys_Data', | ||||
'linkurl' => 'shops_operations.php' | 'linkurl' => 'shops_operations.php' | ||||
), | ), | ||||
5 => array( | 5 => array( | ||||
'title' => Lang('sys_payment'), | |||||
'description' => Lang('sys_payment_desc'), | |||||
'title' => '支付接口设置', | |||||
'description' => '商店以及会员产品付款用到的在线付款方式需要设置的支付接口,这里含有常用的接口', | |||||
'purview' => 'sys_Data', | 'purview' => 'sys_Data', | ||||
'linkurl' => 'sys_payment.php' | 'linkurl' => 'sys_payment.php' | ||||
), | ), | ||||
6 => array( | |||||
'title' => '配货方式设置', | |||||
'description' => '网站在线商城的送货方式,这里可以对其进行编辑管理', | |||||
'purview' => 'sys_Data', | |||||
'linkurl' => 'shops_delivery.php' | |||||
), | |||||
7 => array( | |||||
'title' => '汇款账号设置', | |||||
'description' => '银行付款的账号设置,用户可以查看到您的银行付款账号方便支付', | |||||
'purview' => 'sys_Data', | |||||
'linkurl' => 'shops_bank.php' | |||||
), | |||||
) | ) | ||||
); | ); | ||||
$actionSearch[7] = array( | $actionSearch[7] = array( | ||||
'toptitle' => Lang('makehtml'), | |||||
'title' => Lang('makehtml_task'), | |||||
'description' => Lang('makehtml_task_desc'), | |||||
'toptitle' => '生成', | |||||
'title' => '更新任务', | |||||
'description' => '一键生成静态管理', | |||||
'soniterm' => array( | 'soniterm' => array( | ||||
0 => array( | 0 => array( | ||||
'title' => Lang('makehtml_all'), | |||||
'description' => Lang('makehtml_all_desc'), | |||||
'title' => '更新网站', | |||||
'description' => '可以一键生成所有静态页面', | |||||
'purview' => 'sys_MakeHtml', | 'purview' => 'sys_MakeHtml', | ||||
'linkurl' => 'makehtml_all.php' | 'linkurl' => 'makehtml_all.php' | ||||
), | ), | ||||
1 => array( | 1 => array( | ||||
'title' => Lang('makehtml_homepage'), | |||||
'description' => Lang('makehtml_homepage_desc'), | |||||
'title' => '更新主页', | |||||
'description' => '生成网站主页面', | |||||
'purview' => 'sys_MakeHtml', | 'purview' => 'sys_MakeHtml', | ||||
'linkurl' => 'makehtml_homepage.php' | 'linkurl' => 'makehtml_homepage.php' | ||||
), | ), | ||||
2 => array( | 2 => array( | ||||
'title' => Lang('makehtml_list'), | |||||
'description' => Lang('makehtml_list_desc'), | |||||
'title' => '更新栏目', | |||||
'description' => '对每个栏目进行静态页面的生成', | |||||
'purview' => 'sys_MakeHtml', | 'purview' => 'sys_MakeHtml', | ||||
'linkurl' => 'makehtml_list.php' | 'linkurl' => 'makehtml_list.php' | ||||
), | ), | ||||
3 => array( | 3 => array( | ||||
'title' => Lang('makehtml_archives'), | |||||
'description' => Lang('makehtml_archives_desc'), | |||||
'title' => '更新文档', | |||||
'description' => '对每个栏目下的文档进行静态页面的生成', | |||||
'purview' => 'sys_MakeHtml', | 'purview' => 'sys_MakeHtml', | ||||
'linkurl' => 'makehtml_archives.php' | 'linkurl' => 'makehtml_archives.php' | ||||
), | ), | ||||
4 => array( | 4 => array( | ||||
'title' => Lang('makehtml_spec'), | |||||
'description' => Lang('makehtml_spec_desc'), | |||||
'title' => '更新专题', | |||||
'description' => '对专题进行静态页面的生成', | |||||
'purview' => 'sys_MakeHtml', | 'purview' => 'sys_MakeHtml', | ||||
'linkurl' => 'makehtml_spec.php' | 'linkurl' => 'makehtml_spec.php' | ||||
), | ), | ||||
5 => array( | 5 => array( | ||||
'title' => Lang('sys_cache_up'), | |||||
'description' => Lang('sys_cache_up_desc'), | |||||
'title' => '更新缓存', | |||||
'description' => '更新栏目缓存、更新枚举缓存、清理arclist调用缓存、清理过期会员访问历史、删除过期短信 ', | |||||
'purview' => 'sys_ArcBatch', | 'purview' => 'sys_ArcBatch', | ||||
'linkurl' => 'sys_cache_up.php' | 'linkurl' => 'sys_cache_up.php' | ||||
), | ), | ||||
) | ) | ||||
); | ); | ||||
$actionSearch[8] = DEDEBIZ_SAFE_MODE? null : array( | $actionSearch[8] = DEDEBIZ_SAFE_MODE? null : array( | ||||
'toptitle' => Lang('template'), | |||||
'title' => Lang('templets_main'), | |||||
'description' => Lang('templets_main_desc'), | |||||
'toptitle' => '模板', | |||||
'title' => '模板管理', | |||||
'description' => '针对主页、栏目、文档、专题等等进行更新', | |||||
'soniterm' => array( | 'soniterm' => array( | ||||
0 => array( | 0 => array( | ||||
'title' => Lang('templets_main2'), | |||||
'description' => Lang('templets_main2_desc'), | |||||
'title' => '默认模板管理 ', | |||||
'description' => '对网站正在采用的模板文件进行管理', | |||||
'purview' => 'temp_All', | 'purview' => 'temp_All', | ||||
'linkurl' => 'templets_main.php' | 'linkurl' => 'templets_main.php' | ||||
), | ), | ||||
1 => array( | 1 => array( | ||||
'title' => Lang('templets_tagsource'), | |||||
'description' => Lang('templets_tagsource_desc'), | |||||
'title' => '标签源码管理 ', | |||||
'description' => '对现有的标签文件进行修改添加', | |||||
'purview' => 'temp_All', | 'purview' => 'temp_All', | ||||
'linkurl' => 'templets_tagsource.php' | 'linkurl' => 'templets_tagsource.php' | ||||
), | ), | ||||
2 => array( | 2 => array( | ||||
'title' => Lang('mytag_main'), | |||||
'description' => Lang('mytag_main_desc'), | |||||
'title' => '自定义宏标记', | |||||
'description' => '管理自定义标记', | |||||
'purview' => 'temp_MyTag', | 'purview' => 'temp_MyTag', | ||||
'linkurl' => 'mytag_main.php' | 'linkurl' => 'mytag_main.php' | ||||
), | ), | ||||
3 => array( | 3 => array( | ||||
'title' => Lang('mytag_tag_guide'), | |||||
'description' => Lang('mytag_tag_guide_desc'), | |||||
'title' => '智能标记向导', | |||||
'description' => '可以根据需要生成相应的调用标签', | |||||
'purview' => 'temp_Other', | 'purview' => 'temp_Other', | ||||
'linkurl' => 'mytag_tag_guide.php' | 'linkurl' => 'mytag_tag_guide.php' | ||||
), | ), | ||||
4 => array( | 4 => array( | ||||
'title' => Lang('tag_test'), | |||||
'description' => Lang('tag_test_desc'), | |||||
'title' => '全局标记测试 ', | |||||
'description' => '可以对全局的标签调用进行测试', | |||||
'purview' => 'temp_Test', | 'purview' => 'temp_Test', | ||||
'linkurl' => 'tag_test.php' | 'linkurl' => 'tag_test.php' | ||||
), | ), | ||||
) | ) | ||||
); | ); | ||||
$actionSearch[9] = array( | $actionSearch[9] = array( | ||||
'toptitle' => Lang('system'), | |||||
'title' => Lang('setting'), | |||||
'description' => Lang('setting_desc'), | |||||
'toptitle' => '系统', | |||||
'title' => '系统设置', | |||||
'description' => '对网站的一些基本信息和配置进行管理', | |||||
'soniterm' => array( | 'soniterm' => array( | ||||
0 => array( | 0 => array( | ||||
'title' => Lang('sys_info'), | |||||
'description' => Lang('sys_info_desc'), | |||||
'title' => '系统配置变量', | |||||
'description' => '包含站点设置、核心设置 、附件设置、会员设置、互动设置、性能选项、其它选项、添加新变量等分类,其中有网站基本信息和网站的基本设置选项', | |||||
'purview' => 'sys_Edit', | 'purview' => 'sys_Edit', | ||||
'linkurl' => 'sys_info.php' | 'linkurl' => 'sys_info.php' | ||||
), | ), | ||||
1 => array( | 1 => array( | ||||
'title' => Lang('sys_admin_user'), | |||||
'description' => Lang('sys_admin_user_desc'), | |||||
'title' => '系统用户管理', | |||||
'description' => '对现有的网站管理员进行管理', | |||||
'purview' => 'sys_User', | 'purview' => 'sys_User', | ||||
'linkurl' => 'sys_admin_user.php' | 'linkurl' => 'sys_admin_user.php' | ||||
), | ), | ||||
2 => array( | 2 => array( | ||||
'title' => Lang('sys_group'), | |||||
'description' => Lang('sys_group_desc'), | |||||
'title' => '用户组设定', | |||||
'description' => '对网站管理员进行用户组别的划分', | |||||
'purview' => 'sys_Group', | 'purview' => 'sys_Group', | ||||
'linkurl' => 'sys_group.php' | 'linkurl' => 'sys_group.php' | ||||
), | ), | ||||
3 => array( | 3 => array( | ||||
'title' => Lang('log_list'), | |||||
'description' => Lang('log_list_desc'), | |||||
'title' => '系统日志管理', | |||||
'description' => '对每个登录后台的管理员进行的操作进行记录', | |||||
'purview' => 'sys_Log', | 'purview' => 'sys_Log', | ||||
'linkurl' => 'log_list.php' | 'linkurl' => 'log_list.php' | ||||
), | ), | ||||
5 => array( | 5 => array( | ||||
'title' => Lang('sys_info_mark'), | |||||
'description' => Lang('sys_info_mark_desc'), | |||||
'title' => '图片水印设置', | |||||
'description' => '对于上传的图片添加的水印进行配置', | |||||
'purview' => 'sys_Edit', | 'purview' => 'sys_Edit', | ||||
'linkurl' => 'sys_info_mark.php' | 'linkurl' => 'sys_info_mark.php' | ||||
), | ), | ||||
6 => array( | 6 => array( | ||||
'title' => Lang('content_att'), | |||||
'description' => Lang('content_att_desc'), | |||||
'title' => '自定义文档属性', | |||||
'description' => '在以往的版本中,网站主页、频道封面的设计,都只能单调的用 arclist 标记把某栏目最新或按特定排序方式的文档无选择的读出来,这样做法存在很大的不足,在发布的时候对适合的文档选择专门的属性,那么使用arclist的地方就会按您的意愿显示指定的文档', | |||||
'purview' => 'sys_Att', | 'purview' => 'sys_Att', | ||||
'linkurl' => 'content_att.php' | 'linkurl' => 'content_att.php' | ||||
), | ), | ||||
7 => array( | 7 => array( | ||||
'title' => Lang('soft_config'), | |||||
'description' => Lang('soft_config_desc'), | |||||
'title' => '软件频道设置', | |||||
'description' => '可以对软件下载时的连接显示方式,下载方式,镜像服务器等等进行配置', | |||||
'purview' => 'sys_SoftConfig', | 'purview' => 'sys_SoftConfig', | ||||
'linkurl' => 'soft_config.php' | 'linkurl' => 'soft_config.php' | ||||
), | ), | ||||
8 => array( | 8 => array( | ||||
'title' => Lang('article_string_mix'), | |||||
'description' => Lang('article_string_mix_desc'), | |||||
'title' => '防采集串混淆', | |||||
'description' => '防采集混淆字符串管理', | |||||
'purview' => 'sys_StringMix', | 'purview' => 'sys_StringMix', | ||||
'linkurl' => 'article_string_mix.php' | 'linkurl' => 'article_string_mix.php' | ||||
), | ), | ||||
9 => array( | 9 => array( | ||||
'title' => Lang('article_template_rand'), | |||||
'description' => Lang('article_template_rand_desc'), | |||||
'title' => '随机模板设置', | |||||
'description' => '本设置仅适用于系统默认的文档模型,设置后发布文档时会自动按指定的模板随机获取一个,如果不想使用此功能,把它设置为空即可', | |||||
'purview' => 'sys_StringMix', | 'purview' => 'sys_StringMix', | ||||
'linkurl' => 'article_template_rand.php' | 'linkurl' => 'article_template_rand.php' | ||||
), | ), | ||||
11 => array( | 11 => array( | ||||
'title' => Lang('sys_data'), | |||||
'description' => Lang('sys_data_desc'), | |||||
'title' => '数据库备份还原', | |||||
'description' => '对数据库进行备份和还原', | |||||
'purview' => 'sys_data', | 'purview' => 'sys_data', | ||||
'linkurl' => 'sys_data.php' | 'linkurl' => 'sys_data.php' | ||||
), | ), | ||||
12 => DEDEBIZ_SAFE_MODE? null : array( | 12 => DEDEBIZ_SAFE_MODE? null : array( | ||||
'title' => Lang('sys_sql_query'), | |||||
'description' => Lang('sys_sql_query_desc'), | |||||
'title' => 'SQL命令行工具', | |||||
'description' => '可以在针对每张数据表执行单行或者多行的SQL语句', | |||||
'purview' => 'sys_data', | 'purview' => 'sys_data', | ||||
'linkurl' => 'sys_sql_query.php' | 'linkurl' => 'sys_sql_query.php' | ||||
), | ), | ||||
14 => array( | 14 => array( | ||||
'title' => Lang('sys_safetest'), | |||||
'description' => Lang('sys_safetest_desc'), | |||||
'title' => '病毒扫描', | |||||
'description' => '以DedeBIZ开发模式为标准对现有的文件进行扫描并进行判断', | |||||
'purview' => 'sys_verifies', | 'purview' => 'sys_verifies', | ||||
'linkurl' => 'sys_safetest.php' | 'linkurl' => 'sys_safetest.php' | ||||
), | ), | ||||
15 => array( | 15 => array( | ||||
'title' => Lang('sys_repair'), | |||||
'description' => Lang('sys_repair_desc'), | |||||
'title' => '系统错误修复', | |||||
'description' => '由于手动升级时用户没运行指定的SQL语句,或自动升级的遗漏处理或处理出错,可能会导致一些错误,使用本工具会自动检测并处理', | |||||
'purview' => 'sys_verifies', | 'purview' => 'sys_verifies', | ||||
'linkurl' => 'sys_repair.php' | 'linkurl' => 'sys_repair.php' | ||||
), | ), | ||||
@@ -1,13 +1,4 @@ | |||||
<?php | <?php | ||||
/** | |||||
* 后台操作记录信息 | |||||
* | |||||
* @version $Id: inc_admin_channel.php 2022-07-01 tianya $ | |||||
* @package DedeBIZ.Administrator | |||||
* @copyright Copyright (c) 2022, DedeBIZ.COM | |||||
* @license https://www.dedebiz.com/license | |||||
* @link https://www.dedebiz.com | |||||
*/ | |||||
/** | /** | ||||
* 获得字段创建信息 | * 获得字段创建信息 | ||||
* | * | ||||
@@ -21,87 +12,87 @@ | |||||
function GetFieldMake($dtype, $fieldname, $dfvalue, $mxlen) | function GetFieldMake($dtype, $fieldname, $dfvalue, $mxlen) | ||||
{ | { | ||||
$fields = array(); | $fields = array(); | ||||
if ($dtype == "int" || $dtype == "datetime") | |||||
if($dtype == "int" || $dtype == "datetime") | |||||
{ | { | ||||
if ($dfvalue == "" || preg_match("#[^0-9-]#", $dfvalue)) | |||||
if($dfvalue == "" || preg_match("#[^0-9-]#", $dfvalue)) | |||||
{ | { | ||||
$dfvalue = 0; | $dfvalue = 0; | ||||
} | } | ||||
$fields[0] = " `$fieldname` int(11) NOT NULL default '$dfvalue';"; | $fields[0] = " `$fieldname` int(11) NOT NULL default '$dfvalue';"; | ||||
$fields[1] = "int(11)"; | $fields[1] = "int(11)"; | ||||
} | } | ||||
else if ($dtype == "stepselect") | |||||
else if($dtype == "stepselect") | |||||
{ | { | ||||
if ($dfvalue == "" || preg_match("#[^0-9\.-]#", $dfvalue)) | |||||
if($dfvalue == "" || preg_match("#[^0-9\.-]#", $dfvalue)) | |||||
{ | { | ||||
$dfvalue = 0; | $dfvalue = 0; | ||||
} | } | ||||
$fields[0] = " `$fieldname` char(20) NOT NULL default '$dfvalue';"; | $fields[0] = " `$fieldname` char(20) NOT NULL default '$dfvalue';"; | ||||
$fields[1] = "char(20)"; | $fields[1] = "char(20)"; | ||||
} | } | ||||
else if ($dtype == "float") | |||||
else if($dtype == "float") | |||||
{ | { | ||||
if ($dfvalue == "" || preg_match("#[^0-9\.-]#", $dfvalue)) | |||||
if($dfvalue == "" || preg_match("#[^0-9\.-]#", $dfvalue)) | |||||
{ | { | ||||
$dfvalue = 0; | $dfvalue = 0; | ||||
} | } | ||||
$fields[0] = " `$fieldname` float NOT NULL default '$dfvalue';"; | $fields[0] = " `$fieldname` float NOT NULL default '$dfvalue';"; | ||||
$fields[1] = "float"; | $fields[1] = "float"; | ||||
} | } | ||||
else if ($dtype == "img" || $dtype == "media" || $dtype == "addon" || $dtype == "imgfile") | |||||
else if($dtype == "img" || $dtype == "media" || $dtype == "addon" || $dtype == "imgfile") | |||||
{ | { | ||||
if (empty($dfvalue)) $dfvalue = ''; | |||||
if ($mxlen=="") $mxlen = 200; | |||||
if ($mxlen > 255) $mxlen = 100; | |||||
if(empty($dfvalue)) $dfvalue = ''; | |||||
if($mxlen=="") $mxlen = 200; | |||||
if($mxlen > 255) $mxlen = 100; | |||||
$fields[0] = " `$fieldname` varchar($mxlen) NOT NULL default '$dfvalue';"; | $fields[0] = " `$fieldname` varchar($mxlen) NOT NULL default '$dfvalue';"; | ||||
$fields[1] = "varchar($mxlen)"; | $fields[1] = "varchar($mxlen)"; | ||||
} | } | ||||
else if ($dtype == "multitext" || $dtype == "htmltext") | |||||
else if($dtype == "multitext" || $dtype == "htmltext") | |||||
{ | { | ||||
$fields[0] = " `$fieldname` mediumtext;"; | $fields[0] = " `$fieldname` mediumtext;"; | ||||
$fields[1] = "mediumtext"; | $fields[1] = "mediumtext"; | ||||
} | } | ||||
else if ($dtype=="textdata") | |||||
else if($dtype=="textdata") | |||||
{ | { | ||||
if (empty($dfvalue)) $dfvalue = ''; | |||||
if(empty($dfvalue)) $dfvalue = ''; | |||||
$fields[0] = " `$fieldname` varchar(100) NOT NULL default '';"; | $fields[0] = " `$fieldname` varchar(100) NOT NULL default '';"; | ||||
$fields[1] = "varchar(100)"; | $fields[1] = "varchar(100)"; | ||||
} | } | ||||
else if ($dtype=="relation") { | |||||
if (empty($dfvalue)) $dfvalue = ''; | |||||
else if($dtype=="relation") { | |||||
if(empty($dfvalue)) $dfvalue = ''; | |||||
$fields[0] = " `$fieldname` TEXT NOT NULL default '$dfvalue';"; | $fields[0] = " `$fieldname` TEXT NOT NULL default '$dfvalue';"; | ||||
$fields[1] = "TEXT"; | $fields[1] = "TEXT"; | ||||
} | } | ||||
else if ($dtype=="textchar") | |||||
else if($dtype=="textchar") | |||||
{ | { | ||||
if (empty($dfvalue)) $dfvalue = ''; | |||||
if(empty($dfvalue)) $dfvalue = ''; | |||||
$fields[0] = " `$fieldname` char(100) NOT NULL default '$dfvalue';"; | $fields[0] = " `$fieldname` char(100) NOT NULL default '$dfvalue';"; | ||||
$fields[1] = "char(100)"; | $fields[1] = "char(100)"; | ||||
} | } | ||||
else if ($dtype=="checkbox") | |||||
else if($dtype=="checkbox") | |||||
{ | { | ||||
$dfvalue = str_replace(',',"','",$dfvalue); | $dfvalue = str_replace(',',"','",$dfvalue); | ||||
$dfvalue = "'".$dfvalue."'"; | $dfvalue = "'".$dfvalue."'"; | ||||
$fields[0] = " `$fieldname` SET($dfvalue) NULL;"; | $fields[0] = " `$fieldname` SET($dfvalue) NULL;"; | ||||
$fields[1] = "SET($dfvalue)"; | $fields[1] = "SET($dfvalue)"; | ||||
} | } | ||||
else if ($dtype=="select" || $dtype=="radio") | |||||
else if($dtype=="select" || $dtype=="radio") | |||||
{ | { | ||||
$dfvalue = str_replace(',', "','", $dfvalue); | $dfvalue = str_replace(',', "','", $dfvalue); | ||||
$dfvalue = "'".$dfvalue."'"; | $dfvalue = "'".$dfvalue."'"; | ||||
$fields[0] = " `$fieldname` enum($dfvalue) NULL;"; | $fields[0] = " `$fieldname` enum($dfvalue) NULL;"; | ||||
$fields[1] = "enum($dfvalue)"; | $fields[1] = "enum($dfvalue)"; | ||||
} else { | } else { | ||||
if (empty($dfvalue)) | |||||
if(empty($dfvalue)) | |||||
{ | { | ||||
$dfvalue = ''; | $dfvalue = ''; | ||||
} | } | ||||
if (empty($mxlen)) | |||||
if(empty($mxlen)) | |||||
{ | { | ||||
$mxlen = 100; | $mxlen = 100; | ||||
} | } | ||||
if ($mxlen > 255) | |||||
if($mxlen > 255) | |||||
{ | { | ||||
$mxlen = 250; | $mxlen = 250; | ||||
} | } | ||||
@@ -123,11 +114,11 @@ function GetAddFieldList(&$dtp,&$oksetting) | |||||
$oklist = ''; | $oklist = ''; | ||||
$dtp->SetNameSpace("field","<",">"); | $dtp->SetNameSpace("field","<",">"); | ||||
$dtp->LoadSource($oksetting); | $dtp->LoadSource($oksetting); | ||||
if (is_array($dtp->CTags)) | |||||
if(is_array($dtp->CTags)) | |||||
{ | { | ||||
foreach($dtp->CTags as $tagid=>$ctag) | foreach($dtp->CTags as $tagid=>$ctag) | ||||
{ | { | ||||
if ($ctag->GetAtt('islist')==1) | |||||
if($ctag->GetAtt('islist')==1) | |||||
{ | { | ||||
$oklist .= ($oklist=='' ? strtolower($ctag->GetName()) : ','.strtolower($ctag->GetName()) ); | $oklist .= ($oklist=='' ? strtolower($ctag->GetName()) : ','.strtolower($ctag->GetName()) ); | ||||
} | } | ||||
@@ -2,24 +2,20 @@ | |||||
/** | /** | ||||
* 文档操作相关函数 | * 文档操作相关函数 | ||||
* | * | ||||
* @version $Id: inc_archives_functions.php 2022-07-01 tianya $ | |||||
* @version $Id: inc_archives_functions.php 1 9:56 2010年7月21日Z tianya $ | |||||
* @package DedeBIZ.Administrator | * @package DedeBIZ.Administrator | ||||
* @copyright Copyright (c) 2022, DedeBIZ.COM | * @copyright Copyright (c) 2022, DedeBIZ.COM | ||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Archive\Archives; | |||||
use DedeBIZ\Database\DedeSql; | |||||
use DedeBIZ\libraries\DedeBIZ; | |||||
use DedeBIZ\libraries\DedeHttpDown; | |||||
use DedeBIZ\libraries\SplitWord; | |||||
use DedeBIZ\Login\UserLogin; | |||||
use DedeBIZ\Template\DedeTagParse; | |||||
helper('dedecollection'); | |||||
helper('customfields'); | |||||
helper('image'); | |||||
require_once(DEDEINC.'/libraries/dedehttpdown.class.php'); | |||||
require_once(DEDEINC.'/image.func.php'); | |||||
require_once(DEDEINC.'/archive/partview.class.php'); | |||||
$backurl = !empty($_COOKIE['ENV_GOBACK_URL']) ? $_COOKIE['ENV_GOBACK_URL'] : ''; | $backurl = !empty($_COOKIE['ENV_GOBACK_URL']) ? $_COOKIE['ENV_GOBACK_URL'] : ''; | ||||
$backurl = preg_match("#content_#", $backurl) ? "<a href='$backurl' class='btn btn-success btn-sm'>".Lang('content_list_remeber')."</a>" : ''; | |||||
$backurl = preg_match("#content_#", $backurl) ? "<a href='$backurl' class='btn btn-success btn-sm'>记忆的列表页</a>" : ''; | |||||
if (!isset($_NOT_ARCHIVES)) { | |||||
require_once(DEDEINC.'/customfields.func.php'); | |||||
} | |||||
/** | /** | ||||
* 获得HTML里的外部资源,针对图集 | * 获得HTML里的外部资源,针对图集 | ||||
* | * | ||||
@@ -32,7 +28,8 @@ $backurl = preg_match("#content_#", $backurl) ? "<a href='$backurl' class='btn b | |||||
function GetCurContentAlbum($body, $rfurl, &$firstdd) | function GetCurContentAlbum($body, $rfurl, &$firstdd) | ||||
{ | { | ||||
global $dsql, $cfg_multi_site, $cfg_basehost, $cfg_ddimg_width; | global $dsql, $cfg_multi_site, $cfg_basehost, $cfg_ddimg_width; | ||||
global $cfg_basedir, $pagestyle, $cUserLogin, $cfg_addon_savetype; | |||||
global $cfg_basedir, $pagestyle, $cuserLogin, $cfg_addon_savetype; | |||||
require_once(DEDEINC.'/dedecollection.func.php'); | |||||
if (empty($cfg_ddimg_width)) $cfg_ddimg_width = 320; | if (empty($cfg_ddimg_width)) $cfg_ddimg_width = 320; | ||||
$rsimg = ''; | $rsimg = ''; | ||||
$cfg_uploaddir = $GLOBALS['cfg_image_dir']; | $cfg_uploaddir = $GLOBALS['cfg_image_dir']; | ||||
@@ -68,10 +65,10 @@ function GetCurContentAlbum($body, $rfurl, &$firstdd) | |||||
$fsize = filesize($rndFileName); | $fsize = filesize($rndFileName); | ||||
$filename = $milliSecond.'-'.$key.$itype; | $filename = $milliSecond.'-'.$key.$itype; | ||||
//保存图片附件信息 | //保存图片附件信息 | ||||
$inquery = "INSERT INTO `#@__uploads`(arcid,title,url,mediatype,width,height,playtime,filesize,uptime,mid) VALUES ('0','$filename','$iurl','1','{$imginfos[0]}','$imginfos[1]','0','$fsize','".time()."','".$cUserLogin->getUserID()."');"; | |||||
$inquery = "INSERT INTO `#@__uploads` (arcid,title,url,mediatype,width,height,playtime,filesize,uptime,mid) VALUES ('0','$filename','$iurl','1','{$imginfos[0]}','$imginfos[1]','0','$fsize','".time()."','".$cuserLogin->getUserID()."'); "; | |||||
$dsql->ExecuteNoneQuery($inquery); | $dsql->ExecuteNoneQuery($inquery); | ||||
$fid = $dsql->GetLastID(); | $fid = $dsql->GetLastID(); | ||||
UserLogin::AddMyAddon($fid, $iurl); | |||||
AddMyAddon($fid, $iurl); | |||||
if ($pagestyle > 2) { | if ($pagestyle > 2) { | ||||
$litpicname = GetImageMapDD($iurl, $cfg_ddimg_width); | $litpicname = GetImageMapDD($iurl, $cfg_ddimg_width); | ||||
} else { | } else { | ||||
@@ -98,7 +95,7 @@ function GetCurContentAlbum($body, $rfurl, &$firstdd) | |||||
*/ | */ | ||||
function GetCurContent($body) | function GetCurContent($body) | ||||
{ | { | ||||
global $cfg_multi_site, $cfg_basehost, $cfg_basedir, $cfg_image_dir, $arcID, $cUserLogin, $dsql; | |||||
global $cfg_multi_site, $cfg_basehost, $cfg_basedir, $cfg_image_dir, $arcID, $cuserLogin, $dsql; | |||||
$cfg_uploaddir = $cfg_image_dir; | $cfg_uploaddir = $cfg_image_dir; | ||||
$htd = new DedeHttpDown(); | $htd = new DedeHttpDown(); | ||||
$basehost = IsSSL()? "https://".$_SERVER["HTTP_HOST"] : "http://".$_SERVER["HTTP_HOST"]; | $basehost = IsSSL()? "https://".$_SERVER["HTTP_HOST"] : "http://".$_SERVER["HTTP_HOST"]; | ||||
@@ -124,6 +121,7 @@ function GetCurContent($body) | |||||
continue; | continue; | ||||
} | } | ||||
$htd->OpenUrl($value); | $htd->OpenUrl($value); | ||||
$itype = $htd->GetHead("content-type"); | $itype = $htd->GetHead("content-type"); | ||||
$isImage = true; | $isImage = true; | ||||
if ($itype == 'image/gif') { | if ($itype == 'image/gif') { | ||||
@@ -133,11 +131,11 @@ function GetCurContent($body) | |||||
} else if ($itype == 'audio/mpeg'){ | } else if ($itype == 'audio/mpeg'){ | ||||
$itype = ".mp3"; | $itype = ".mp3"; | ||||
$isImage = false; | $isImage = false; | ||||
} else if ($itype == 'image/jpeg') { | |||||
} else if($itype == 'image/jpeg') { | |||||
$itype = '.jpg'; | $itype = '.jpg'; | ||||
} else if ($itype == 'image/bmp') { | |||||
} else if($itype == 'image/bmp') { | |||||
$itype = '.bmp'; | $itype = '.bmp'; | ||||
} else if ($itype == 'image/svg+xml') { | |||||
} else if($itype == 'image/svg+xml') { | |||||
$itype = '.svg'; | $itype = '.svg'; | ||||
$isImage = false; | $isImage = false; | ||||
} else { | } else { | ||||
@@ -156,10 +154,10 @@ function GetCurContent($body) | |||||
} | } | ||||
$fsize = filesize($rndFileName); | $fsize = filesize($rndFileName); | ||||
//保存图片附件信息 | //保存图片附件信息 | ||||
$inquery = "INSERT INTO `#@__uploads`(arcid,title,url,mediatype,width,height,playtime,filesize,uptime,mid) VALUES ('{$arcID}','$rndFileName','$fileurl','1','{$imginfos[0]}','$imginfos[1]','0','$fsize','".time()."','".$cUserLogin->getUserID()."');"; | |||||
$inquery = "INSERT INTO `#@__uploads` (arcid,title,url,mediatype,width,height,playtime,filesize,uptime,mid) VALUES ('{$arcID}','$rndFileName','$fileurl','1','{$imginfos[0]}','$imginfos[1]','0','$fsize','".time()."','".$cuserLogin->getUserID()."'); "; | |||||
$dsql->ExecuteNoneQuery($inquery); | $dsql->ExecuteNoneQuery($inquery); | ||||
$fid = $dsql->GetLastID(); | $fid = $dsql->GetLastID(); | ||||
UserLogin::AddMyAddon($fid, $fileurl); | |||||
AddMyAddon($fid, $fileurl); | |||||
if ($cfg_multi_site == 'Y') { | if ($cfg_multi_site == 'Y') { | ||||
$fileurl = $cfg_basehost.$fileurl; | $fileurl = $cfg_basehost.$fileurl; | ||||
} | } | ||||
@@ -232,7 +230,7 @@ function CheckChannel($typeid, $channelid) | |||||
{ | { | ||||
global $dsql; | global $dsql; | ||||
if ($typeid == 0) return TRUE; | if ($typeid == 0) return TRUE; | ||||
$row = $dsql->GetOne("SELECT ispart,channeltype FROM `#@__arctype` WHERE id='$typeid'"); | |||||
$row = $dsql->GetOne("SELECT ispart,channeltype FROM `#@__arctype` WHERE id='$typeid' "); | |||||
if ($row['ispart'] != 0 || $row['channeltype'] != $channelid) return FALSE; | if ($row['ispart'] != 0 || $row['channeltype'] != $channelid) return FALSE; | ||||
else return TRUE; | else return TRUE; | ||||
} | } | ||||
@@ -247,7 +245,7 @@ function CheckChannel($typeid, $channelid) | |||||
function CheckArcAdmin($aid, $adminid) | function CheckArcAdmin($aid, $adminid) | ||||
{ | { | ||||
global $dsql; | global $dsql; | ||||
$row = $dsql->GetOne("SELECT mid FROM `#@__archives` WHERE id='$aid'"); | |||||
$row = $dsql->GetOne("SELECT mid FROM `#@__archives` WHERE id='$aid' "); | |||||
if ($row['mid'] != $adminid) return FALSE; | if ($row['mid'] != $adminid) return FALSE; | ||||
else return TRUE; | else return TRUE; | ||||
} | } | ||||
@@ -308,14 +306,16 @@ function SpLongBody($mybody, $spsize, $sptag) | |||||
* @access public | * @access public | ||||
* @param string $aid 文档id | * @param string $aid 文档id | ||||
* @param string $ismakesign 生成标志 | * @param string $ismakesign 生成标志 | ||||
* @param int $isremote 是否远程 | |||||
* @return string | * @return string | ||||
*/ | */ | ||||
function MakeArt($aid, $mkindex = FALSE, $ismakesign = FALSE) | |||||
function MakeArt($aid, $mkindex = FALSE, $ismakesign = FALSE, $isremote = 0) | |||||
{ | { | ||||
global $envs, $typeid; | global $envs, $typeid; | ||||
require_once(DEDEINC.'/archive/archives.class.php'); | |||||
if ($ismakesign) $envs['makesign'] = 'yes'; | if ($ismakesign) $envs['makesign'] = 'yes'; | ||||
$arc = new Archives($aid); | $arc = new Archives($aid); | ||||
$reurl = $arc->MakeHtml(); | |||||
$reurl = $arc->MakeHtml($isremote); | |||||
return $reurl; | return $reurl; | ||||
} | } | ||||
/** | /** | ||||
@@ -348,7 +348,7 @@ function GetDDImgFromBody(&$body) | |||||
*/ | */ | ||||
function GetDDImage($litpic, $picname, $isremote) | function GetDDImage($litpic, $picname, $isremote) | ||||
{ | { | ||||
global $cUserLogin, $cfg_ddimg_width, $cfg_ddimg_height, $cfg_basedir, $cfg_image_dir, $cfg_addon_savetype; | |||||
global $cuserLogin, $cfg_ddimg_width, $cfg_ddimg_height, $cfg_basedir, $cfg_image_dir, $cfg_addon_savetype; | |||||
$ntime = time(); | $ntime = time(); | ||||
if (($litpic != 'none' || $litpic != 'ddfirst') && !empty($_FILES[$litpic]['tmp_name']) && is_uploaded_file($_FILES[$litpic]['tmp_name']) | if (($litpic != 'none' || $litpic != 'ddfirst') && !empty($_FILES[$litpic]['tmp_name']) && is_uploaded_file($_FILES[$litpic]['tmp_name']) | ||||
) { | ) { | ||||
@@ -357,12 +357,12 @@ function GetDDImage($litpic, $picname, $isremote) | |||||
$sparr = array("image/pjpeg", "image/jpeg", "image/gif", "image/png"); | $sparr = array("image/pjpeg", "image/jpeg", "image/gif", "image/png"); | ||||
$_FILES[$litpic]['type'] = strtolower(trim($_FILES[$litpic]['type'])); | $_FILES[$litpic]['type'] = strtolower(trim($_FILES[$litpic]['type'])); | ||||
if (!in_array($_FILES[$litpic]['type'], $sparr)) { | if (!in_array($_FILES[$litpic]['type'], $sparr)) { | ||||
ShowMsg(Lang("dialog_err_imageformat"), "-1"); | |||||
ShowMsg("上传的图片格式错误,请使用JPEG、GIF、PNG格式的其中一种", "-1"); | |||||
exit(); | exit(); | ||||
} | } | ||||
$savepath = $cfg_image_dir.'/'.MyDate($cfg_addon_savetype, $ntime); | $savepath = $cfg_image_dir.'/'.MyDate($cfg_addon_savetype, $ntime); | ||||
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)); | |||||
if (strtolower($_FILES[$litpic]['type']) == "image/gif") { | if (strtolower($_FILES[$litpic]['type']) == "image/gif") { | ||||
$fullUrl = $fullUrl.".gif"; | $fullUrl = $fullUrl.".gif"; | ||||
} else if (strtolower($_FILES[$litpic]['type']) == "image/png") { | } else if (strtolower($_FILES[$litpic]['type']) == "image/png") { | ||||
@@ -372,11 +372,11 @@ function GetDDImage($litpic, $picname, $isremote) | |||||
} | } | ||||
$mime = get_mime_type($_FILES[$litpic]['tmp_name']); | $mime = get_mime_type($_FILES[$litpic]['tmp_name']); | ||||
if (preg_match("#^unknow#", $mime)) { | if (preg_match("#^unknow#", $mime)) { | ||||
ShowMsg(Lang("media_no_fileinfo"), -1); | |||||
ShowMsg("系统不支持fileinfo组件,建议php.ini中开启", -1); | |||||
exit; | exit; | ||||
} | } | ||||
if (!preg_match("#^(image|video|audio|application)#i", $mime)) { | if (!preg_match("#^(image|video|audio|application)#i", $mime)) { | ||||
ShowMsg(Lang("media_only_media"), -1); | |||||
ShowMsg("仅支持媒体文件及应用程序上传", -1); | |||||
exit; | exit; | ||||
} | } | ||||
@move_uploaded_file($_FILES[$litpic]['tmp_name'], $cfg_basedir.$fullUrl); | @move_uploaded_file($_FILES[$litpic]['tmp_name'], $cfg_basedir.$fullUrl); | ||||
@@ -388,7 +388,7 @@ function GetDDImage($litpic, $picname, $isremote) | |||||
$picname = trim($picname); | $picname = trim($picname); | ||||
if ($isremote == 1 && preg_match("#^http:\/\/#i", $picname)) { | if ($isremote == 1 && preg_match("#^http:\/\/#i", $picname)) { | ||||
$litpic = $picname; | $litpic = $picname; | ||||
$ddinfos = GetRemoteImage($litpic, $cUserLogin->getUserID()); | |||||
$ddinfos = GetRemoteImage($litpic, $cuserLogin->getUserID()); | |||||
if (!is_array($ddinfos)) { | if (!is_array($ddinfos)) { | ||||
$litpic = ''; | $litpic = ''; | ||||
} else { | } else { | ||||
@@ -401,7 +401,7 @@ function GetDDImage($litpic, $picname, $isremote) | |||||
} else { | } else { | ||||
if ($litpic == 'ddfirst' && !preg_match("#^http:\/\/#i", $picname)) { | if ($litpic == 'ddfirst' && !preg_match("#^http:\/\/#i", $picname)) { | ||||
$oldpic = $cfg_basedir.$picname; | $oldpic = $cfg_basedir.$picname; | ||||
$litpic = str_replace('.', '-icon.', $picname); | |||||
$litpic = str_replace('.', '-ty.', $picname); | |||||
if ($GLOBALS['cfg_ddimg_full'] == 'Y') @ImageResizeNew($oldpic, $cfg_ddimg_width, $cfg_ddimg_height, $cfg_basedir.$litpic); | if ($GLOBALS['cfg_ddimg_full'] == 'Y') @ImageResizeNew($oldpic, $cfg_ddimg_width, $cfg_ddimg_height, $cfg_basedir.$litpic); | ||||
else @ImageResize($oldpic, $cfg_ddimg_width, $cfg_ddimg_height, $cfg_basedir.$litpic); | else @ImageResize($oldpic, $cfg_ddimg_width, $cfg_ddimg_height, $cfg_basedir.$litpic); | ||||
if (!is_file($cfg_basedir.$litpic)) $litpic = ''; | if (!is_file($cfg_basedir.$litpic)) $litpic = ''; | ||||
@@ -519,7 +519,7 @@ function PrintAutoFieldsEdit(&$fieldset, &$fieldValues, $loadtype = 'all') | |||||
*/ | */ | ||||
function AnalyseHtmlBody($body, &$description, &$litpic, &$keywords, $dtype = '') | function AnalyseHtmlBody($body, &$description, &$litpic, &$keywords, $dtype = '') | ||||
{ | { | ||||
global $autolitpic, $remote, $dellink, $autokey, $cfg_basehost, $cfg_auot_description, $id, $title; | |||||
global $autolitpic, $remote, $dellink, $autokey, $cfg_basehost, $cfg_auot_description, $id, $title, $cfg_soft_lang; | |||||
global $cfg_bizcore_appid, $cfg_bizcore_key, $cfg_bizcore_hostname, $cfg_bizcore_port; | global $cfg_bizcore_appid, $cfg_bizcore_key, $cfg_bizcore_hostname, $cfg_bizcore_port; | ||||
$autolitpic = (empty($autolitpic) ? '' : $autolitpic); | $autolitpic = (empty($autolitpic) ? '' : $autolitpic); | ||||
$body = stripslashes($body); | $body = stripslashes($body); | ||||
@@ -547,25 +547,26 @@ function AnalyseHtmlBody($body, &$description, &$litpic, &$keywords, $dtype = '' | |||||
$litpic = GetDDImgFromBody($body); | $litpic = GetDDImgFromBody($body); | ||||
} | } | ||||
//自动获取关键词 | //自动获取关键词 | ||||
if ($autokey == 1 && $keywords == '') { | |||||
if ($autokey == 2 && $keywords == '') { | |||||
$subject = $title; | $subject = $title; | ||||
$message = $body; | $message = $body; | ||||
//采用DedeBIZ Core分词组件分词 | //采用DedeBIZ Core分词组件分词 | ||||
if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | ||||
$keywords = ''; | $keywords = ''; | ||||
$client = new DedeBIZ($cfg_bizcore_hostname, $cfg_bizcore_port); | |||||
$client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port); | |||||
$client->appid = $cfg_bizcore_appid; | $client->appid = $cfg_bizcore_appid; | ||||
$client->key = $cfg_bizcore_key; | $client->key = $cfg_bizcore_key; | ||||
$data = $client->Spliteword($subject.Html2Text($message)); | $data = $client->Spliteword($subject.Html2Text($message)); | ||||
$keywords = $data->data; | $keywords = $data->data; | ||||
$client->Close(); | $client->Close(); | ||||
} else { | } else { | ||||
include_once(DEDEINC.'/libraries/splitword.class.php'); | |||||
$keywords = ''; | $keywords = ''; | ||||
$sp = new SplitWord(); | |||||
$sp->SetSource($subject); | |||||
$sp = new SplitWord($cfg_soft_lang, $cfg_soft_lang); | |||||
$sp->SetSource($subject, $cfg_soft_lang, $cfg_soft_lang); | |||||
$sp->StartAnalysis(); | $sp->StartAnalysis(); | ||||
$titleindexs = preg_replace("/#p#|#e#/", '', $sp->GetFinallyIndex()); | $titleindexs = preg_replace("/#p#|#e#/", '', $sp->GetFinallyIndex()); | ||||
$sp->SetSource(Html2Text($message)); | |||||
$sp->SetSource(Html2Text($message), $cfg_soft_lang, $cfg_soft_lang); | |||||
$sp->StartAnalysis(); | $sp->StartAnalysis(); | ||||
$allindexs = preg_replace("/#p#|#e#/", '', $sp->GetFinallyIndex()); | $allindexs = preg_replace("/#p#|#e#/", '', $sp->GetFinallyIndex()); | ||||
if (is_array($allindexs) && is_array($titleindexs)) { | if (is_array($allindexs) && is_array($titleindexs)) { | ||||
@@ -637,9 +638,9 @@ function Replace_Links(&$body, $allow_urls = array()) | |||||
*/ | */ | ||||
function GetImageMapDD($filename, $maxwidth) | function GetImageMapDD($filename, $maxwidth) | ||||
{ | { | ||||
global $cUserLogin, $dsql, $cfg_ddimg_height, $cfg_ddimg_full; | |||||
global $cuserLogin, $dsql, $cfg_ddimg_height, $cfg_ddimg_full; | |||||
$ddn = substr($filename, -3); | $ddn = substr($filename, -3); | ||||
$ddpicok = preg_replace("#\.".$ddn."$#", "-icon.".$ddn, $filename); | |||||
$ddpicok = preg_replace("#\.".$ddn."$#", "-ty.".$ddn, $filename); | |||||
$toFile = $GLOBALS['cfg_basedir'].$ddpicok; | $toFile = $GLOBALS['cfg_basedir'].$ddpicok; | ||||
if ($cfg_ddimg_full == 'Y') ImageResizeNew($GLOBALS['cfg_basedir'].$filename, $maxwidth, $cfg_ddimg_height, $toFile); | if ($cfg_ddimg_full == 'Y') ImageResizeNew($GLOBALS['cfg_basedir'].$filename, $maxwidth, $cfg_ddimg_height, $toFile); | ||||
else ImageResize($GLOBALS['cfg_basedir'].$filename, $maxwidth, $cfg_ddimg_height, $toFile); | else ImageResize($GLOBALS['cfg_basedir'].$filename, $maxwidth, $cfg_ddimg_height, $toFile); | ||||
@@ -647,12 +648,104 @@ function GetImageMapDD($filename, $maxwidth) | |||||
$fsize = filesize($toFile); | $fsize = filesize($toFile); | ||||
$ddpicoks = explode('/', $ddpicok); | $ddpicoks = explode('/', $ddpicok); | ||||
$filename = $ddpicoks[count($ddpicoks) - 1]; | $filename = $ddpicoks[count($ddpicoks) - 1]; | ||||
$inquery = "INSERT INTO `#@__uploads`(arcid,title,url,mediatype,width,height,playtime,filesize,uptime,mid) VALUES ('0','$filename','$ddpicok','1','0','0','0','$fsize','".time()."','".$cUserLogin->getUserID()."');"; | |||||
$inquery = "INSERT INTO `#@__uploads` (arcid,title,url,mediatype,width,height,playtime,filesize,uptime,mid) VALUES ('0','$filename','$ddpicok','1','0','0','0','$fsize','".time()."','".$cuserLogin->getUserID()."'); "; | |||||
$dsql->ExecuteNoneQuery($inquery); | $dsql->ExecuteNoneQuery($inquery); | ||||
$fid = $dsql->GetLastID(); | $fid = $dsql->GetLastID(); | ||||
UserLogin::AddMyAddon($fid, $ddpicok); | |||||
AddMyAddon($fid, $ddpicok); | |||||
return $ddpicok; | return $ddpicok; | ||||
} | } | ||||
/** | |||||
* 上传一个未经处理的图片 | |||||
* | |||||
* @access public | |||||
* @param string $upname 上传框名称 | |||||
* @param string $handurl 手工填写的网址 | |||||
* @param string $ddisremote 是否下载远程图片 0 不下, 1 下载 | |||||
* @param string $ntitle 注解文字 如果表单有 title 字段可不管 | |||||
* @return mixed | |||||
*/ | |||||
function UploadOneImage($upname, $handurl = '', $isremote = 1, $ntitle = '') | |||||
{ | |||||
global $cuserLogin, $cfg_basedir, $cfg_image_dir, $title, $dsql; | |||||
if ($ntitle != '') { | |||||
$title = $ntitle; | |||||
} | |||||
$ntime = time(); | |||||
$filename = ''; | |||||
$isrm_up = FALSE; | |||||
$handurl = trim($handurl); | |||||
//如果用户自行上传了图片 | |||||
if (!empty($_FILES[$upname]['tmp_name']) && is_uploaded_file($_FILES[$upname]['tmp_name'])) { | |||||
$istype = 0; | |||||
$sparr = array("image/pjpeg", "image/jpeg", "image/gif", "image/png"); | |||||
$_FILES[$upname]['type'] = strtolower(trim($_FILES[$upname]['type'])); | |||||
if (!in_array($_FILES[$upname]['type'], $sparr)) { | |||||
ShowMsg("上传的图片格式错误,请使用JPEG、GIF、PNG格式的其中一种", "-1"); | |||||
exit(); | |||||
} | |||||
if (!empty($handurl) && !preg_match("#^http:\/\/#i", $handurl) && file_exists($cfg_basedir.$handurl)) { | |||||
if (!is_object($dsql)) { | |||||
$dsql = new DedeSqli(); | |||||
} | |||||
$dsql->ExecuteNoneQuery("DELETE FROM `#@__uploads` WHERE url LIKE '$handurl' "); | |||||
$fullUrl = preg_replace("#\.([a-z]*)$#i", "", $handurl); | |||||
} else { | |||||
$savepath = $cfg_image_dir.'/'.date("%Y-%m", $ntime); | |||||
CreateDir($savepath); | |||||
$fullUrl = $savepath.'/'.date("%d", $ntime).dd2char(date("%H%M%S", $ntime).'0'.$cuserLogin->getUserID().'0'.mt_rand(1000, 9999)); | |||||
} | |||||
if (strtolower($_FILES[$upname]['type']) == "image/gif") { | |||||
$fullUrl = $fullUrl.".gif"; | |||||
} else if (strtolower($_FILES[$upname]['type']) == "image/png") { | |||||
$fullUrl = $fullUrl.".png"; | |||||
} else { | |||||
$fullUrl = $fullUrl.".jpg"; | |||||
} | |||||
$mime = get_mime_type($_FILES[$upname]['tmp_name']); | |||||
if (preg_match("#^unknow#", $mime)) { | |||||
ShowMsg("系统不支持fileinfo组件,建议php.ini中开启", -1); | |||||
exit; | |||||
} | |||||
if (!preg_match("#^(image|video|audio|application)#i", $mime)) { | |||||
ShowMsg("仅支持媒体文件及应用程序上传", -1); | |||||
exit; | |||||
} | |||||
//保存 | |||||
@move_uploaded_file($_FILES[$upname]['tmp_name'], $cfg_basedir.$fullUrl); | |||||
$filename = $fullUrl; | |||||
//水印 | |||||
@WaterImg($cfg_basedir.$fullUrl, 'up'); | |||||
$isrm_up = TRUE; | |||||
} | |||||
//远程或选择本地图片 | |||||
else { | |||||
if ($handurl == '') { | |||||
return ''; | |||||
} | |||||
//远程图片并要求本地化 | |||||
if ($isremote == 1 && preg_match("#^http[s]?:\/\/#i", $handurl)) { | |||||
$ddinfos = GetRemoteImage($handurl, $cuserLogin->getUserID()); | |||||
if (!is_array($ddinfos)) { | |||||
$litpic = ""; | |||||
} else { | |||||
$filename = $ddinfos[0]; | |||||
} | |||||
$isrm_up = TRUE; | |||||
//本地图片或远程不要求本地化 | |||||
} else { | |||||
$filename = $handurl; | |||||
} | |||||
} | |||||
$imgfile = $cfg_basedir.$filename; | |||||
if (is_file($imgfile) && $isrm_up && $filename != '') { | |||||
$info = ""; | |||||
$imginfos = GetImageSize($imgfile, $info); | |||||
//把新上传的图片信息保存到媒体文档管理档案中 | |||||
$inquery = "INSERT INTO `#@__uploads` (title,url,mediatype,width,height,playtime,filesize,uptime,mid) VALUES ('$title','$filename','1','".$imginfos[0]."','".$imginfos[1]."','0','".filesize($imgfile)."','".time()."','".$cuserLogin->getUserID()."');"; | |||||
$dsql->ExecuteNoneQuery($inquery); | |||||
} | |||||
return $filename; | |||||
} | |||||
/** | /** | ||||
* 获取更新测试信息 | * 获取更新测试信息 | ||||
* | * | ||||
@@ -2,13 +2,12 @@ | |||||
/** | /** | ||||
* 文档操作相关函数 | * 文档操作相关函数 | ||||
* | * | ||||
* @version $Id: inc_batchup.php 2022-07-01 tianya $ | |||||
* @version $Id: inc_batchup.php 1 10:32 2010年7月21日Z tianya $ | |||||
* @package DedeBIZ.Administrator | * @package DedeBIZ.Administrator | ||||
* @copyright Copyright (c) 2022, DedeBIZ.COM | * @copyright Copyright (c) 2022, DedeBIZ.COM | ||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
/** | /** | ||||
* 删除文档信息 | * 删除文档信息 | ||||
* | * | ||||
@@ -21,7 +20,7 @@ use DedeBIZ\Login\UserLogin; | |||||
function DelArc($aid, $type = 'ON', $onlyfile = FALSE, $recycle = 0) | function DelArc($aid, $type = 'ON', $onlyfile = FALSE, $recycle = 0) | ||||
{ | { | ||||
global $dsql, $cfg_cookie_encode, $cfg_multi_site, $cfg_medias_dir; | global $dsql, $cfg_cookie_encode, $cfg_multi_site, $cfg_medias_dir; | ||||
global $cUserLogin, $cfg_upload_switch, $cfg_delete, $cfg_basedir; | |||||
global $cuserLogin, $cfg_upload_switch, $cfg_delete, $cfg_basedir; | |||||
global $admin_catalogs, $cfg_admin_channel; | global $admin_catalogs, $cfg_admin_channel; | ||||
if ($cfg_delete == 'N') $type = 'OK'; | if ($cfg_delete == 'N') $type = 'OK'; | ||||
if (empty($aid)) return; | if (empty($aid)) return; | ||||
@@ -30,7 +29,7 @@ function DelArc($aid, $type = 'ON', $onlyfile = FALSE, $recycle = 0) | |||||
if ($recycle == 1) $whererecycle = "AND arcrank = '-2'"; | if ($recycle == 1) $whererecycle = "AND arcrank = '-2'"; | ||||
else $whererecycle = ""; | else $whererecycle = ""; | ||||
//查询表信息 | //查询表信息 | ||||
$query = "SELECT ch.maintable,ch.addtable,ch.nid,ch.issystem FROM `#@__arctiny` arc LEFT JOIN `#@__arctype` tp ON tp.id=arc.typeid LEFT JOIN `#@__channeltype` ch ON ch.id=arc.channel WHERE arc.id='$aid'"; | |||||
$query = "SELECT ch.maintable,ch.addtable,ch.nid,ch.issystem FROM `#@__arctiny` arc LEFT JOIN `#@__arctype` tp ON tp.id=arc.typeid LEFT JOIN `#@__channeltype` ch ON ch.id=arc.channel WHERE arc.id='$aid' "; | |||||
$row = $dsql->GetOne($query); | $row = $dsql->GetOne($query); | ||||
$nid = $row['nid']; | $nid = $row['nid']; | ||||
$maintable = (trim($row['maintable']) == '' ? '#@__archives' : trim($row['maintable'])); | $maintable = (trim($row['maintable']) == '' ? '#@__archives' : trim($row['maintable'])); | ||||
@@ -38,19 +37,19 @@ function DelArc($aid, $type = 'ON', $onlyfile = FALSE, $recycle = 0) | |||||
$issystem = $row['issystem']; | $issystem = $row['issystem']; | ||||
//查询档案信息 | //查询档案信息 | ||||
if ($issystem == -1) { | if ($issystem == -1) { | ||||
$arcQuery = "SELECT arc.*,tp.* from `$addtable` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id WHERE arc.aid='$aid'"; | |||||
$arcQuery = "SELECT arc.*,tp.* FROM `$addtable` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id WHERE arc.aid='$aid' "; | |||||
} else { | } else { | ||||
$arcQuery = "SELECT arc.*,tp.*,arc.id AS aid FROM `$maintable` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id WHERE arc.id='$aid'"; | |||||
$arcQuery = "SELECT arc.*,tp.*,arc.id AS aid FROM `$maintable` arc LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id WHERE arc.id='$aid' "; | |||||
} | } | ||||
$arcRow = $dsql->GetOne($arcQuery); | $arcRow = $dsql->GetOne($arcQuery); | ||||
//检测权限 | //检测权限 | ||||
if (!UserLogin::TestPurview('a_Del,sys_ArcBatch')) { | |||||
if (UserLogin::TestPurview('a_AccDel')) { | |||||
if (!TestPurview('a_Del,sys_ArcBatch')) { | |||||
if (TestPurview('a_AccDel')) { | |||||
if (!in_array($arcRow['typeid'], $admin_catalogs) && (count($admin_catalogs) != 0 || $cfg_admin_channel != 'all')) { | if (!in_array($arcRow['typeid'], $admin_catalogs) && (count($admin_catalogs) != 0 || $cfg_admin_channel != 'all')) { | ||||
return FALSE; | return FALSE; | ||||
} | } | ||||
} else if (UserLogin::TestPurview('a_MyDel')) { | |||||
if ($arcRow['mid'] != $cUserLogin->getUserID()) { | |||||
} else if (TestPurview('a_MyDel')) { | |||||
if ($arcRow['mid'] != $cuserLogin->getUserID()) { | |||||
return FALSE; | return FALSE; | ||||
} | } | ||||
} else { | } else { | ||||
@@ -62,22 +61,22 @@ function DelArc($aid, $type = 'ON', $onlyfile = FALSE, $recycle = 0) | |||||
if (!is_array($arcRow)) return FALSE; | if (!is_array($arcRow)) return FALSE; | ||||
/** 删除到回收站 **/ | /** 删除到回收站 **/ | ||||
if ($cfg_delete == 'Y' && $type == 'ON') { | if ($cfg_delete == 'Y' && $type == 'ON') { | ||||
$dsql->ExecuteNoneQuery("UPDATE `$maintable` SET arcrank='-2' WHERE id='$aid'"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `#@__arctiny` SET `arcrank` = '-2' WHERE id = '$aid';"); | |||||
$dsql->ExecuteNoneQuery("UPDATE `$maintable` SET arcrank='-2' WHERE id='$aid' "); | |||||
$dsql->ExecuteNoneQuery("UPDATE `#@__arctiny` SET `arcrank` = '-2' WHERE id = '$aid'; "); | |||||
} else { | } else { | ||||
//删除数据库记录 | //删除数据库记录 | ||||
if (!$onlyfile) { | if (!$onlyfile) { | ||||
$query = "Delete From `#@__arctiny` where id='$aid' $whererecycle"; | |||||
$query = "DELETE FROM `#@__arctiny` WHERE id='$aid' $whererecycle"; | |||||
if ($dsql->ExecuteNoneQuery($query)) { | if ($dsql->ExecuteNoneQuery($query)) { | ||||
$dsql->ExecuteNoneQuery("Delete From `#@__feedback` where aid='$aid'"); | |||||
$dsql->ExecuteNoneQuery("Delete From `#@__member_stow` where aid='$aid'"); | |||||
$dsql->ExecuteNoneQuery("Delete From `#@__taglist` where aid='$aid'"); | |||||
$dsql->ExecuteNoneQuery("Delete From `#@__erradd` where aid='$aid'"); | |||||
$dsql->ExecuteNoneQuery("DELETE FROM `#@__feedback` WHERE aid='$aid' "); | |||||
$dsql->ExecuteNoneQuery("DELETE FROM `#@__member_stow` WHERE aid='$aid' "); | |||||
$dsql->ExecuteNoneQuery("DELETE FROM `#@__taglist` WHERE aid='$aid' "); | |||||
$dsql->ExecuteNoneQuery("DELETE FROM `#@__erradd` WHERE aid='$aid' "); | |||||
if ($addtable != '') { | if ($addtable != '') { | ||||
$dsql->ExecuteNoneQuery("Delete From `$addtable` where aid='$aid'"); | |||||
$dsql->ExecuteNoneQuery("DELETE FROM `$addtable` WHERE aid='$aid'"); | |||||
} | } | ||||
if ($issystem != -1) { | if ($issystem != -1) { | ||||
$dsql->ExecuteNoneQuery("Delete From `#@__archives` where id='$aid' $whererecycle"); | |||||
$dsql->ExecuteNoneQuery("DELETE FROM `#@__archives` WHERE id='$aid' $whererecycle"); | |||||
} | } | ||||
//删除相关附件 | //删除相关附件 | ||||
if ($cfg_upload_switch == 'Y') { | if ($cfg_upload_switch == 'Y') { | ||||
@@ -85,7 +84,7 @@ function DelArc($aid, $type = 'ON', $onlyfile = FALSE, $recycle = 0) | |||||
while ($row = $dsql->GetArray('me')) { | while ($row = $dsql->GetArray('me')) { | ||||
$addfile = $row['url']; | $addfile = $row['url']; | ||||
$aid = $row['aid']; | $aid = $row['aid']; | ||||
$dsql->ExecuteNoneQuery("Delete From `#@__uploads` where aid = '$aid'"); | |||||
$dsql->ExecuteNoneQuery("DELETE FROM `#@__uploads` WHERE aid = '$aid' "); | |||||
$upfile = $cfg_basedir.$addfile; | $upfile = $cfg_basedir.$addfile; | ||||
if (@file_exists($upfile)) @unlink($upfile); | if (@file_exists($upfile)) @unlink($upfile); | ||||
} | } | ||||
@@ -2,7 +2,7 @@ | |||||
/** | /** | ||||
* 栏目选项函数 | * 栏目选项函数 | ||||
* | * | ||||
* @version $Id: inc_catalog_options.php 2022-07-01 tianya $ | |||||
* @version $Id: inc_catalog_options.php 1 10:32 2010年7月21日Z tianya $ | |||||
* @package DedeBIZ.Administrator | * @package DedeBIZ.Administrator | ||||
* @copyright Copyright (c) 2022, DedeBIZ.COM | * @copyright Copyright (c) 2022, DedeBIZ.COM | ||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
@@ -20,7 +20,7 @@ | |||||
function GetOptionList($selid = 0, $userCatalog = 0, $channeltype = 0) | function GetOptionList($selid = 0, $userCatalog = 0, $channeltype = 0) | ||||
{ | { | ||||
global $OptionArrayList, $channels, $dsql, $cfg_admin_channel, $admin_catalogs; | global $OptionArrayList, $channels, $dsql, $cfg_admin_channel, $admin_catalogs; | ||||
$dsql->SetQuery("SELECT id,typename FROM `#@__channeltype`"); | |||||
$dsql->SetQuery("SELECT id,typename FROM `#@__channeltype` "); | |||||
$dsql->Execute('dd'); | $dsql->Execute('dd'); | ||||
$channels = array(); | $channels = array(); | ||||
while ($row = $dsql->GetObject('dd')) $channels[$row->id] = $row->typename; | while ($row = $dsql->GetObject('dd')) $channels[$row->id] = $row->typename; | ||||
@@ -34,10 +34,10 @@ function GetOptionList($selid = 0, $userCatalog = 0, $channeltype = 0) | |||||
//是否限定用户管理的栏目 | //是否限定用户管理的栏目 | ||||
if ($cfg_admin_channel == 'array') { | if ($cfg_admin_channel == 'array') { | ||||
if (count($admin_catalogs) == 0) { | if (count($admin_catalogs) == 0) { | ||||
$query = "SELECT id,typename,ispart,channeltype FROM `#@__arctype` WHERE 1=2"; | |||||
$query = "SELECT id,typename,ispart,channeltype FROM `#@__arctype` WHERE 1=2 "; | |||||
} else { | } else { | ||||
$admin_catalog = join(',', $admin_catalogs); | $admin_catalog = join(',', $admin_catalogs); | ||||
$dsql->SetQuery("SELECT reid FROM `#@__arctype` WHERE id IN($admin_catalog) GROUP BY reid"); | |||||
$dsql->SetQuery("SELECT reid FROM `#@__arctype` WHERE id IN($admin_catalog) GROUP BY reid "); | |||||
$dsql->Execute('qq'); | $dsql->Execute('qq'); | ||||
$topidstr = ''; | $topidstr = ''; | ||||
while ($row = $dsql->GetObject('qq')) { | while ($row = $dsql->GetObject('qq')) { | ||||
@@ -49,10 +49,10 @@ function GetOptionList($selid = 0, $userCatalog = 0, $channeltype = 0) | |||||
$admin_catalogs = array_unique($admin_catalogs); | $admin_catalogs = array_unique($admin_catalogs); | ||||
$admin_catalog = join(',', $admin_catalogs); | $admin_catalog = join(',', $admin_catalogs); | ||||
$admin_catalog = preg_replace("#,$#", '', $admin_catalog); | $admin_catalog = preg_replace("#,$#", '', $admin_catalog); | ||||
$query = "SELECT id,typename,ispart,channeltype FROM `#@__arctype` WHERE id in($admin_catalog) And reid=0"; | |||||
$query = "Select id,typename,ispart,channeltype From `#@__arctype` where id in($admin_catalog) And reid=0"; | |||||
} | } | ||||
} else { | } else { | ||||
$query = "SELECT id,typename,ispart,channeltype FROM `#@__arctype` WHERE reid=0 ORDER BY sortrank ASC"; | |||||
$query = "Select id,typename,ispart,channeltype From `#@__arctype` where reid=0 order by sortrank asc"; | |||||
} | } | ||||
$dsql->SetQuery($query); | $dsql->SetQuery($query); | ||||
$dsql->Execute('cc'); | $dsql->Execute('cc'); | ||||
@@ -61,7 +61,7 @@ function GetOptionList($selid = 0, $userCatalog = 0, $channeltype = 0) | |||||
LogicGetOptionArray($row->id, '─', $channeltype, $dsql, $sonCats); | LogicGetOptionArray($row->id, '─', $channeltype, $dsql, $sonCats); | ||||
if ($sonCats != '') { | if ($sonCats != '') { | ||||
if ($row->ispart == 1) $OptionArrayList .= "<option value='".$row->id."' class='option1'>".$row->typename."-封面频道</option>"; | if ($row->ispart == 1) $OptionArrayList .= "<option value='".$row->id."' class='option1'>".$row->typename."-封面频道</option>"; | ||||
else if ($row->ispart == 2) $OptionArrayList .= "<option value='".$row->id."' class='option1'>".$row->typename."-外部连接</option>"; | |||||
else if($row->ispart == 2) $OptionArrayList .= "<option value='".$row->id."' class='option1'>".$row->typename."-外部连接</option>"; | |||||
else if (empty($channeltype) && $row->ispart != 0) $OptionArrayList .= "<option value='".$row->id."' class='option2'>".$row->typename."(".$channels[$row->channeltype].")</option>"; | else if (empty($channeltype) && $row->ispart != 0) $OptionArrayList .= "<option value='".$row->id."' class='option2'>".$row->typename."(".$channels[$row->channeltype].")</option>"; | ||||
else $OptionArrayList .= "<option value='".$row->id."' class='option3'>".$row->typename."</option>"; | else $OptionArrayList .= "<option value='".$row->id."' class='option3'>".$row->typename."</option>"; | ||||
$OptionArrayList .= $sonCats; | $OptionArrayList .= $sonCats; | ||||
@@ -78,7 +78,7 @@ function GetOptionList($selid = 0, $userCatalog = 0, $channeltype = 0) | |||||
function LogicGetOptionArray($id, $step, $channeltype, &$dsql, &$sonCats) | function LogicGetOptionArray($id, $step, $channeltype, &$dsql, &$sonCats) | ||||
{ | { | ||||
global $OptionArrayList, $channels, $cfg_admin_channel, $admin_catalogs; | global $OptionArrayList, $channels, $cfg_admin_channel, $admin_catalogs; | ||||
$dsql->SetQuery("SELECT id,typename,ispart,channeltype FROM `#@__arctype` WHERE reid='".$id."' ORDER BY sortrank ASC"); | |||||
$dsql->SetQuery("Select id,typename,ispart,channeltype From `#@__arctype` where reid='".$id."' order by sortrank asc"); | |||||
$dsql->Execute($id); | $dsql->Execute($id); | ||||
while ($row = $dsql->GetObject($id)) { | while ($row = $dsql->GetObject($id)) { | ||||
if ($cfg_admin_channel != 'all' && !in_array($row->id, $admin_catalogs)) { | if ($cfg_admin_channel != 'all' && !in_array($row->id, $admin_catalogs)) { | ||||
@@ -2,14 +2,13 @@ | |||||
/** | /** | ||||
* 采集指定页面作为文档发布源 | * 采集指定页面作为文档发布源 | ||||
* | * | ||||
* @version $Id: inc_coonepage.php 2022-07-01 tianya $ | |||||
* @version $Id: inc_coonepage.php 1 10:32 2010年7月21日Z tianya $ | |||||
* @package DedeBIZ.Administrator | * @package DedeBIZ.Administrator | ||||
* @copyright Copyright (c) 2022, DedeBIZ.COM | * @copyright Copyright (c) 2022, DedeBIZ.COM | ||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DedeHttpDown; | |||||
helper("charset"); | |||||
require_once(DEDEINC.'/charset.func.php'); | |||||
/** | /** | ||||
* 获取一个页面 | * 获取一个页面 | ||||
* | * | ||||
@@ -19,11 +18,11 @@ helper("charset"); | |||||
*/ | */ | ||||
function CoOnePage($gurl) | function CoOnePage($gurl) | ||||
{ | { | ||||
global $dsql, $cfg_auot_description; | |||||
global $dsql, $cfg_auot_description, $cfg_soft_lang; | |||||
$redatas = array('title' => '', 'body' => '', 'source' => '', 'writer' => '', 'description' => '', 'keywords' => ''); | $redatas = array('title' => '', 'body' => '', 'source' => '', 'writer' => '', 'description' => '', 'keywords' => ''); | ||||
$redatas['source'] = preg_replace("/(http|https):\/\//i", "", $gurl); | $redatas['source'] = preg_replace("/(http|https):\/\//i", "", $gurl); | ||||
$redatas['source'] = preg_replace("/\/(.*)$/i", "", $redatas['source']); | $redatas['source'] = preg_replace("/\/(.*)$/i", "", $redatas['source']); | ||||
$row = $dsql->GetOne("SELECT * FROM `#@__co_onepage` WHERE url LIKE '".$redatas['source']."'"); | |||||
$row = $dsql->GetOne("SELECT * FROM `#@__co_onepage` WHERE url LIKE '".$redatas['source']."' "); | |||||
$s = $e = ''; | $s = $e = ''; | ||||
if (is_array($row)) { | if (is_array($row)) { | ||||
list($s, $e) = explode('{@body}', $row['rule']); | list($s, $e) = explode('{@body}', $row['rule']); | ||||
@@ -38,8 +37,14 @@ function CoOnePage($gurl) | |||||
$body = $htd->GetHtml(); | $body = $htd->GetHtml(); | ||||
if ($body != '') { | if ($body != '') { | ||||
//编码自动转换 | //编码自动转换 | ||||
if ($row['lang'] == 'gb2312') { | |||||
$body = gb2utf8($body); | |||||
if ($cfg_soft_lang == 'utf-8') { | |||||
if ($row['lang'] == 'gb2312') { | |||||
$body = gb2utf8($body); | |||||
} | |||||
} else if ($cfg_soft_lang == 'gb2312') { | |||||
if ($row['lang'] == 'utf-8') { | |||||
$body = utf82gb($body); | |||||
} | |||||
} | } | ||||
//获取标题 | //获取标题 | ||||
$inarr = array(); | $inarr = array(); | ||||
@@ -2,7 +2,7 @@ | |||||
/** | /** | ||||
* 列表对应函数 | * 列表对应函数 | ||||
* | * | ||||
* @version $Id: inc_list_functions.php 2022-07-01 tianya $ | |||||
* @version $Id: inc_list_functions.php 1 10:32 2010年7月21日Z tianya $ | |||||
* @package DedeBIZ.Administrator | * @package DedeBIZ.Administrator | ||||
* @copyright Copyright (c) 2022, DedeBIZ.COM | * @copyright Copyright (c) 2022, DedeBIZ.COM | ||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
@@ -23,7 +23,7 @@ function GetTypename($tid) | |||||
return base64_decode($cfg_Cs[$tid][3]); | return base64_decode($cfg_Cs[$tid][3]); | ||||
} | } | ||||
} else { | } else { | ||||
$row = $dsql->GetOne("SELECT typename FROM `#@__arctype` WHERE id = '{$tid}'"); | |||||
$row = $dsql->GetOne("SELECT typename FROM #@__arctype WHERE id = '{$tid}'"); | |||||
unset($dsql); | unset($dsql); | ||||
unset($cfg_Cs); | unset($cfg_Cs); | ||||
return isset($row['typename']) ? $row['typename'] : ''; | return isset($row['typename']) ? $row['typename'] : ''; | ||||
@@ -70,18 +70,18 @@ function CheckPic($picname) | |||||
if ($picname != "") { | if ($picname != "") { | ||||
return $picname; | return $picname; | ||||
} else { | } else { | ||||
return "/static/web/img/thumbnail.jpg"; | |||||
return "/static/web/img/defaultpic.jpg"; | |||||
} | } | ||||
} | } | ||||
//判断内容是否生成网页 | //判断内容是否生成网页 | ||||
function IsHtmlArchives($ismake) | function IsHtmlArchives($ismake) | ||||
{ | { | ||||
if ($ismake == 1) { | if ($ismake == 1) { | ||||
return Lang("ismake_1"); | |||||
return "已生成"; | |||||
} else if ($ismake == -1) { | } else if ($ismake == -1) { | ||||
return Lang("ismake_-1"); | |||||
return "仅动态"; | |||||
} else { | } else { | ||||
return "<span class='text-danger'>".Lang('ismake_0')."</span>"; | |||||
return "<span class='text-danger'>未生成</span>"; | |||||
} | } | ||||
} | } | ||||
//获得内容的限定级别名称 | //获得内容的限定级别名称 | ||||
@@ -89,7 +89,7 @@ function GetRankName($arcrank) | |||||
{ | { | ||||
global $arcArray, $dsql; | global $arcArray, $dsql; | ||||
if (!is_array($arcArray)) { | if (!is_array($arcArray)) { | ||||
$dsql->SetQuery("SELECT * FROM `#@__arcrank`"); | |||||
$dsql->SetQuery("SELECT * FROM `#@__arcrank` "); | |||||
$dsql->Execute(); | $dsql->Execute(); | ||||
while ($row = $dsql->GetObject()) { | while ($row = $dsql->GetObject()) { | ||||
$arcArray[$row->rank] = $row->membername; | $arcArray[$row->rank] = $row->membername; | ||||
@@ -98,14 +98,14 @@ function GetRankName($arcrank) | |||||
if (isset($arcArray[$arcrank])) { | if (isset($arcArray[$arcrank])) { | ||||
return $arcArray[$arcrank]; | return $arcArray[$arcrank]; | ||||
} else { | } else { | ||||
return Lang("unlimited"); | |||||
return "不限"; | |||||
} | } | ||||
} | } | ||||
//判断内容是否为图片文档 | //判断内容是否为图片文档 | ||||
function IsPicArchives($picname) | function IsPicArchives($picname) | ||||
{ | { | ||||
if ($picname != '') { | if ($picname != '') { | ||||
return "<span class='text-danger'>[".Lang('img')."]</span>"; | |||||
return "<span class='text-danger'>[图]</span>"; | |||||
} else { | } else { | ||||
return ''; | return ''; | ||||
} | } | ||||
@@ -2,22 +2,21 @@ | |||||
/** | /** | ||||
* 后台管理菜单项 | * 后台管理菜单项 | ||||
* | * | ||||
* @version $Id: inc_menu.php 2022-07-01 tianya $ | |||||
* @version $Id: inc_menu.php 1 10:32 2010年7月21日Z tianya $ | |||||
* @package DedeBIZ.Administrator | * @package DedeBIZ.Administrator | ||||
* @copyright Copyright (c) 2022, DedeBIZ.COM | * @copyright Copyright (c) 2022, DedeBIZ.COM | ||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
require_once(dirname(__FILE__)."/../config.php"); | require_once(dirname(__FILE__)."/../config.php"); | ||||
require_once(dirname(__FILE__)."/inc_menu_module.php"); | |||||
//载入可发布频道 | //载入可发布频道 | ||||
$addset = ''; | $addset = ''; | ||||
//检测可用的内容模型 | //检测可用的内容模型 | ||||
if ($cfg_admin_channel = 'array' && count($admin_catalogs) > 0) { | if ($cfg_admin_channel = 'array' && count($admin_catalogs) > 0) { | ||||
$admin_catalog = join(',', $admin_catalogs); | $admin_catalog = join(',', $admin_catalogs); | ||||
$dsql->SetQuery("SELECT channeltype FROM `#@__arctype` WHERE id IN({$admin_catalog}) GROUP BY channeltype"); | |||||
$dsql->SetQuery("SELECT channeltype FROM `#@__arctype` WHERE id IN({$admin_catalog}) GROUP BY channeltype "); | |||||
} else { | } else { | ||||
$dsql->SetQuery("SELECT channeltype FROM `#@__arctype` GROUP BY channeltype"); | |||||
$dsql->SetQuery("SELECT channeltype FROM `#@__arctype` GROUP BY channeltype "); | |||||
} | } | ||||
$dsql->Execute(); | $dsql->Execute(); | ||||
$candoChannel = ''; | $candoChannel = ''; | ||||
@@ -25,104 +24,100 @@ while ($row = $dsql->GetObject()) { | |||||
$candoChannel .= ($candoChannel == '' ? $row->channeltype : ','.$row->channeltype); | $candoChannel .= ($candoChannel == '' ? $row->channeltype : ','.$row->channeltype); | ||||
} | } | ||||
if (empty($candoChannel)) $candoChannel = 1; | if (empty($candoChannel)) $candoChannel = 1; | ||||
$dsql->SetQuery("SELECT id,nid,typename,addcon,mancon FROM `#@__channeltype` WHERE id IN({$candoChannel}) AND id<>-1 AND isshow=1 ORDER BY id ASC"); | |||||
$dsql->SetQuery("SELECT id,typename,addcon,mancon FROM `#@__channeltype` WHERE id IN({$candoChannel}) AND id<>-1 AND isshow=1 ORDER BY id ASC"); | |||||
$dsql->Execute('mm'); | $dsql->Execute('mm'); | ||||
while ($row = $dsql->GetObject('mm')) { | while ($row = $dsql->GetObject('mm')) { | ||||
$name = $row->typename; | |||||
if ($dlang->Exists("ch_{$row->nid}")) { | |||||
$name = "ch_{$row->nid}"; | |||||
} | |||||
$addset .= "<m:item name='{$name}' ischannel='1' link='{$row->mancon}?channelid={$row->id}' linkadd='{$row->addcon}?channelid={$row->id}' channelid='{$row->id}' rank='' target='main' />"; | |||||
$addset .= "<m:item name='{$row->typename}' ischannel='1' link='{$row->mancon}?channelid={$row->id}' linkadd='{$row->addcon}?channelid={$row->id}' channelid='{$row->id}' rank='' target='main' />"; | |||||
} | } | ||||
$helpUrl = DEDEBIZURL."/help"; | $helpUrl = DEDEBIZURL."/help"; | ||||
$gitUrl = DEDEBIZURL."/git"; | $gitUrl = DEDEBIZURL."/git"; | ||||
$dedebizUrl = DEDEBIZURL; | $dedebizUrl = DEDEBIZURL; | ||||
$adminMenu1 = $adminMenu2 = ''; | $adminMenu1 = $adminMenu2 = ''; | ||||
if ($cUserLogin->getUserType() >= 10) { | |||||
$adminMenu1 = (DEDEBIZ_SAFE_MODE? "" : "<m:top item='7' name='templets_main' rank='temp_One,temp_Other,temp_MyTag,temp_test,temp_All' icon='fa-cube'> | |||||
<m:item name='default_templets_main' link='templets_main.php' rank='temp_All' target='main' /> | |||||
<m:item name='templets_tagsource' link='templets_tagsource.php' rank='temp_All' target='main' /> | |||||
<m:item name='mytag_main' link='mytag_main.php' rank='temp_MyTag' target='main' /> | |||||
<m:item name='mytag_tag_guide' link='mytag_tag_guide.php' rank='temp_Other' target='main' /> | |||||
<m:item name='tag_test' link='tag_test.php' rank='temp_Test' target='main' /> | |||||
if ($cuserLogin->getUserType() >= 10) { | |||||
$adminMenu1 = (DEDEBIZ_SAFE_MODE? "" : "<m:top item='7_' name='模板管理' display='block' rank='temp_One,temp_Other,temp_MyTag,temp_test,temp_All'> | |||||
<m:item name='默认模板管理' link='templets_main.php' rank='temp_All' target='main' /> | |||||
<m:item name='标签源码管理' link='templets_tagsource.php' rank='temp_All' target='main' /> | |||||
<m:item name='自定义宏标记' link='mytag_main.php' rank='temp_MyTag' target='main' /> | |||||
<m:item name='智能标记向导' link='mytag_tag_guide.php' rank='temp_Other' target='main' /> | |||||
<m:item name='全局标记测试' link='tag_test.php' rank='temp_Test' target='main' /> | |||||
</m:top>")." | </m:top>")." | ||||
<m:top item='1' name='mychannel' rank='t_List,t_AccList,c_List,temp_One' icon='fa-area-chart'> | |||||
<m:item name='mychannel_main' link='mychannel_main.php' rank='c_List' target='main' /> | |||||
<m:item name='templets_one' link='templets_one.php' rank='temp_One' target='main' /> | |||||
<m:item name='stepselect_main' link='stepselect_main.php' rank='c_Stepseclect' target='main' /> | |||||
<m:item name='freelist_main' link='freelist_main.php' rank='c_List' target='main' /> | |||||
<m:item name='diy_main' link='diy_main.php' rank='c_List' target='main' /> | |||||
<m:top item='1_7_' name='频道模型' display='block' rank='t_List,t_AccList,c_List,temp_One'> | |||||
<m:item name='内容模型管理' link='mychannel_main.php' rank='c_List' target='main' /> | |||||
<m:item name='单页文档管理' link='templets_one.php' rank='temp_One' target='main' /> | |||||
<m:item name='联动类别管理' link='stepselect_main.php' rank='c_Stepseclect' target='main' /> | |||||
<m:item name='自由列表管理' link='freelist_main.php' rank='c_List' target='main' /> | |||||
<m:item name='自定义表单' link='diy_main.php' rank='c_List' target='main' /> | |||||
</m:top>"; | </m:top>"; | ||||
$adminMenu2 = "<m:top item='6' name='pay_tools' rank='sys_Data' icon='fa-credit-card'> | |||||
<m:item name='cards_type' link='cards_type.php' rank='sys_Data' target='main' /> | |||||
<m:item name='cards_manage' link='cards_manage.php' rank='sys_Data' target='main' /> | |||||
<m:item name='member_type' link='member_type.php' rank='sys_Data' target='main' /> | |||||
<m:item name='member_operations' link='member_operations.php' rank='sys_Data' target='main' /> | |||||
<m:item name='shops_operations' link='shops_operations.php' rank='sys_Data' target='main' /> | |||||
<m:item name='sys_payment' link='sys_payment.php' .php' rank='sys_Data' target='main' /> | |||||
$adminMenu2 = "<m:top item='6_' name='支付工具' display='block' rank='sys_Data'> | |||||
<m:item name='点卡产品分类' link='cards_type.php' rank='sys_Data' target='main' /> | |||||
<m:item name='点卡产品管理' link='cards_manage.php' rank='sys_Data' target='main' /> | |||||
<m:item name='会员产品分类' link='member_type.php' rank='sys_Data' target='main' /> | |||||
<m:item name='会员消费记录' link='member_operations.php' rank='sys_Data' target='main' /> | |||||
<m:item name='商店订单记录' link='shops_operations.php' rank='sys_Data' target='main' /> | |||||
<m:item name='支付接口设置' link='sys_payment.php' .php' rank='sys_Data' target='main' /> | |||||
<m:item name='配货方式设置' link='shops_delivery.php' rank='sys_Data' target='main' /> | |||||
</m:top> | </m:top> | ||||
<m:top item='10' name='sys_setting' rank='sys_User,sys_Group,sys_Edit,sys_Log,sys_Data' icon='fa-cog'> | |||||
<m:item name='sys_info' link='sys_info.php' rank='sys_Edit' target='main' /> | |||||
<m:item name='sys_admin_user' link='sys_admin_user.php' rank='sys_User' target='main' /> | |||||
<m:item name='sys_group' link='sys_group.php' rank='sys_Group' target='main' /> | |||||
<m:item name='log_list' link='log_list.php' rank='sys_Log' target='main' /> | |||||
<m:item name='sys_info_mark' link='sys_info_mark.php' rank='sys_Edit' target='main' /> | |||||
<m:item name='content_att' link='content_att.php' rank='sys_Att' target='main' /> | |||||
<m:item name='soft_config' link='soft_config.php' rank='sys_SoftConfig' target='main' /> | |||||
<m:item name='article_string_mix' link='article_string_mix.php' rank='sys_StringMix' target='main' /> | |||||
<m:item name='article_template_rand' link='article_template_rand.php' rank='sys_StringMix' target='main' /> | |||||
".(DEDEBIZ_SAFE_MODE? "" : "<m:item name='sys_data' link='sys_data.php' rank='sys_Data' target='main' />")." | |||||
".(DEDEBIZ_SAFE_MODE? "" : "<m:item name='sys_sql_query' link='sys_sql_query.php' rank='sys_Data' target='main' />")." | |||||
<m:item name='sys_safetest' link='sys_safetest.php' rank='sys_verify' target='main' /> | |||||
<m:item name='sys_repair' link='sys_repair.php' rank='sys_verify' target='main' /> | |||||
<m:top item='10_' name='系统设置' display='block' rank='sys_User,sys_Group,sys_Edit,sys_Log,sys_Data'> | |||||
<m:item name='系统配置变量' link='sys_info.php' rank='sys_Edit' target='main' /> | |||||
<m:item name='系统用户管理' link='sys_admin_user.php' rank='sys_User' target='main' /> | |||||
<m:item name='用户组设定' link='sys_group.php' rank='sys_Group' target='main' /> | |||||
<m:item name='系统日志管理' link='log_list.php' rank='sys_Log' target='main' /> | |||||
<m:item name='图片水印设置' link='sys_info_mark.php' rank='sys_Edit' target='main' /> | |||||
<m:item name='自定义文档属性' link='content_att.php' rank='sys_Att' target='main' /> | |||||
<m:item name='软件频道设置' link='soft_config.php' rank='sys_SoftConfig' target='main' /> | |||||
<m:item name='防采集串混淆' link='article_string_mix.php' rank='sys_StringMix' target='main' /> | |||||
<m:item name='随机模板设置' link='article_template_rand.php' rank='sys_StringMix' target='main' /> | |||||
".(DEDEBIZ_SAFE_MODE? "" : "<m:item name='数据备份还原' link='sys_data.php' rank='sys_Data' target='main' />")." | |||||
".(DEDEBIZ_SAFE_MODE? "" : "<m:item name='SQL命令行工具' link='sys_sql_query.php' rank='sys_Data' target='main' />")." | |||||
<m:item name='病毒文件扫描' link='sys_safetest.php' rank='sys_verify' target='main' /> | |||||
<m:item name='系统错误修复' link='sys_repair.php' rank='sys_verify' target='main' /> | |||||
</m:top>"; | </m:top>"; | ||||
} | } | ||||
$menusMain = "<m:top item='1' name='common_operation' icon='fa-desktop'> | |||||
<m:item name='site_catalog_main' link='catalog_main.php' ischannel='1' addalt='catalog_add' linkadd='catalog_add.php?listtype=all' rank='t_List,t_AccList' target='main' /> | |||||
<m:item name='content_list' link='content_list.php' rank='a_List,a_AccList' target='main' /> | |||||
<m:item name='content_list_-1' link='content_list.php?arcrank=-1' rank='a_Check,a_AccCheck' target='main' /> | |||||
<m:item name='content_list_me' link='content_list.php?mid=".$cUserLogin->getUserID()."' rank='a_List,a_AccList,a_MyList' target='main' /> | |||||
<m:item name='feedback_main' link='feedback_main.php' rank='sys_Feedback' target='main' /> | |||||
<m:item name='recycling' link='recycling.php' ischannel='1' addalt='clear_recycling' addico='fa-minus-circle' linkadd='archives_do.php?dopost=clear&aid=no&recycle=1' rank='a_List,a_AccList,a_MyList' target='main' /> | |||||
$menusMain = "<m:top item='1_' name='常用操作' display='block'> | |||||
<m:item name='网站栏目管理' link='catalog_main.php' ischannel='1' addalt='创建栏目' linkadd='catalog_add.php?listtype=all' rank='t_List,t_AccList' target='main' /> | |||||
<m:item name='所有文档列表' link='content_list.php' rank='a_List,a_AccList' target='main' /> | |||||
<m:item name='等审核的档案' link='content_list.php?arcrank=-1' rank='a_Check,a_AccCheck' target='main' /> | |||||
<m:item name='我发布的文档' link='content_list.php?mid=".$cuserLogin->getUserID()."' rank='a_List,a_AccList,a_MyList' target='main' /> | |||||
<m:item name='评论管理' link='feedback_main.php' rank='sys_Feedback' target='main' /> | |||||
<m:item name='文档回收站' link='recycling.php' ischannel='1' addalt='清空回收站' addico='fa-minus-circle' linkadd='archives_do.php?dopost=clear&aid=no&recycle=1' rank='a_List,a_AccList,a_MyList' target='main' /> | |||||
</m:top> | </m:top> | ||||
<m:top item='1' name='content_main' icon='fa-file-text'> | |||||
<m:top item='1_' name='内容管理' display='block'> | |||||
$addset | $addset | ||||
<m:item name='content_s_list' ischannel='1' link='content_s_list.php' linkadd='spec_add.php' channelid='-1' rank='spec_New' target='main' /> | |||||
<m:item name='专题管理' ischannel='1' link='content_s_list.php' linkadd='spec_add.php' channelid='-1' rank='spec_New' target='main' /> | |||||
</m:top> | </m:top> | ||||
<m:top item='2' name='attachment_main' rank='sys_Upload,sys_MyUpload,plus_文件管理器' icon='fa-folder'> | |||||
<m:item name='media_add' link='media_add.php' rank='' target='main' /> | |||||
<m:item name='media_main' link='media_main.php' rank='sys_Upload,sys_MyUpload' target='main' /> | |||||
<m:item name='media_main_filemanager' link='media_main.php?dopost=filemanager' rank='plus_文件管理器' target='main' /> | |||||
<m:top item='1_' name='附件管理' display='none' rank='sys_Upload,sys_MyUpload,plus_文件管理器'> | |||||
<m:item name='上传新文件' link='media_add.php' rank='' target='main' /> | |||||
<m:item name='附件数据管理' link='media_main.php' rank='sys_Upload,sys_MyUpload' target='main' /> | |||||
<m:item name='文件式管理器' link='media_main.php?dopost=filemanager' rank='plus_文件管理器' target='main' /> | |||||
</m:top> | </m:top> | ||||
$adminMenu1 | $adminMenu1 | ||||
<m:top item='1' name='batch_main' icon='fa-refresh'> | |||||
<m:item name='content_batch_up' link='content_batch_up.php' rank='sys_ArcBatch' target='main' /> | |||||
<m:item name='search_keywords_main' link='search_keywords_main.php' rank='sys_Keyword' target='main' /> | |||||
<m:item name='article_keywords_main' link='article_keywords_main.php' rank='sys_Keyword' target='main' /> | |||||
<m:item name='article_test_same' link='article_test_same.php' rank='sys_ArcBatch' target='main' /> | |||||
<m:item name='article_description_main' link='article_description_main.php' rank='sys_Keyword' target='main' /> | |||||
<m:item name='tags_main' link='tags_main.php' rank='sys_Keyword' target='main' /> | |||||
".(DEDEBIZ_SAFE_MODE? "" : "<m:item name='sys_data_replace' link='sys_data_replace.php' rank='sys_ArcBatch' target='main' />")." | |||||
<m:top item='1_' name='批量维护' display='block'> | |||||
<m:item name='文档批量维护' link='content_batch_up.php' rank='sys_ArcBatch' target='main' /> | |||||
<m:item name='搜索关键词维护' link='search_keywords_main.php' rank='sys_Keyword' target='main' /> | |||||
<m:item name='文档关键词维护' link='article_keywords_main.php' rank='sys_Keyword' target='main' /> | |||||
<m:item name='重复文档检测' link='article_test_same.php' rank='sys_ArcBatch' target='main' /> | |||||
<m:item name='自动摘要分页' link='article_description_main.php' rank='sys_Keyword' target='main' /> | |||||
<m:item name='Tag标签管理' link='tags_main.php' rank='sys_Keyword' target='main' /> | |||||
".(DEDEBIZ_SAFE_MODE? "" : "<m:item name='数据库内容替换' link='sys_data_replace.php' rank='sys_ArcBatch' target='main' />")." | |||||
</m:top> | </m:top> | ||||
{$GLOBALS['menusMoudle']} | |||||
<m:top item='1' name='makehtml_task' rank='sys_MakeHtml' icon='fa-repeat'> | |||||
<m:item name='makehtml_all' link='makehtml_all.php' rank='sys_MakeHtml' target='main' /> | |||||
<m:item name='makehtml_homepage' link='makehtml_homepage.php' rank='sys_MakeHtml' target='main' /> | |||||
<m:item name='makehtml_list' link='makehtml_list.php' rank='sys_MakeHtml' target='main' /> | |||||
<m:item name='makehtml_archives' link='makehtml_archives.php' rank='sys_MakeHtml' target='main' /> | |||||
<m:item name='makehtml_taglist' link='makehtml_taglist.php' rank='sys_MakeHtml' target='main' /> | |||||
<m:item name='makehtml_spec' link='makehtml_spec.php' rank='sys_MakeHtml' target='main' /> | |||||
<m:item name='sys_cache_up' link='sys_cache_up.php' rank='sys_ArcBatch' target='main' /> | |||||
<m:top item='5_' name='更新任务' display='block' notshowall='1' rank='sys_MakeHtml'> | |||||
<m:item name='更新整站' link='makehtml_all.php' rank='sys_MakeHtml' target='main' /> | |||||
<m:item name='更新首页' link='makehtml_homepage.php' rank='sys_MakeHtml' target='main' /> | |||||
<m:item name='更新栏目' link='makehtml_list.php' rank='sys_MakeHtml' target='main' /> | |||||
<m:item name='更新文档' link='makehtml_archives.php' rank='sys_MakeHtml' target='main' /> | |||||
<m:item name='更新标签' link='makehtml_taglist.php' rank='sys_MakeHtml' target='main' /> | |||||
<m:item name='更新专题' link='makehtml_spec.php' rank='sys_MakeHtml' target='main' /> | |||||
<m:item name='更新缓存' link='sys_cache_up.php' rank='sys_ArcBatch' target='main' /> | |||||
</m:top> | </m:top> | ||||
<m:top item='6' name='user_main' rank='member_List,member_Type' icon='fa-user-circle'> | |||||
<m:item name='member_main' link='member_main.php' rank='member_List' target='main' /> | |||||
<m:item name='member_rank' link='member_rank.php' rank='member_Type' target='main' /> | |||||
<m:item name='member_scores' link='member_scores.php' rank='member_Type' target='main' /> | |||||
<m:item name='member_pm' link='member_pm.php' rank='member_Type' target='main' /> | |||||
<m:top item='6_' name='会员管理' display='block' rank='member_List,member_Type'> | |||||
<m:item name='注册会员列表' link='member_main.php' rank='member_List' target='main' /> | |||||
<m:item name='会员级别设置' link='member_rank.php' rank='member_Type' target='main' /> | |||||
<m:item name='积分头衔设置' link='member_scores.php' rank='member_Type' target='main' /> | |||||
<m:item name='会员短信管理' link='member_pm.php' rank='member_Type' target='main' /> | |||||
</m:top> | </m:top> | ||||
$adminMenu2 | $adminMenu2 | ||||
<m:top item='5' name='dedebiz_help' icon='fa-info-circle'> | |||||
<m:item name='dedebiz_intro' link='$cfg_biz_helpUrl' rank='' target='_blank' /> | |||||
<m:item name='dedebiz_git' link='$cfg_biz_gitUrl' rank='' target='_blank' /> | |||||
<m:top item='5_10_' name='系统帮助' display='none'> | |||||
<m:item name='系统概况' link='$cfg_biz_helpUrl' rank='' target='_blank' /> | |||||
<m:item name='代码托管' link='$cfg_biz_gitUrl' rank='' target='_blank' /> | |||||
</m:top>"; | </m:top>"; | ||||
?> | ?> |
@@ -2,17 +2,16 @@ | |||||
/** | /** | ||||
* 管理菜单函数 | * 管理菜单函数 | ||||
* | * | ||||
* @version $Id: inc_menu_func.php 2022-07-01 tianya $ | |||||
* @version $Id: inc_menu_func.php 1 10:32 2010年7月21日Z tianya $ | |||||
* @package DedeBIZ.Administrator | * @package DedeBIZ.Administrator | ||||
* @copyright Copyright (c) 2022, DedeBIZ.COM | * @copyright Copyright (c) 2022, DedeBIZ.COM | ||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
use DedeBIZ\Template\DedeTagParse; | |||||
require_once(dirname(__FILE__)."/../config.php"); | require_once(dirname(__FILE__)."/../config.php"); | ||||
$headTemplet = '<li><div class="link"><i class="fa ~icon~"></i>~channelname~<i class="fa fa-angle-down"></i></div><ul class="submenu">'; | |||||
$footTemplet = "</ul></li>"; | |||||
require_once(DEDEINC."/dedetag.class.php"); | |||||
$headTemplet = "<dl class='bitem' id='sunitems~cc~'><dt onClick='showHide(\"items~cc~\",this)'><b><i class='fa fa-angle-down'></i>~channelname~</b></dt><dd style='display:~display~' class='sitem' id='items~cc~'><ul class='sitemu'>"; | |||||
$footTemplet = "</ul></dd></dl>"; | |||||
$itemTemplet = "<li>~link~</li>"; | $itemTemplet = "<li>~link~</li>"; | ||||
function GetMenus($userrank, $topos = 'main') | function GetMenus($userrank, $topos = 'main') | ||||
{ | { | ||||
@@ -31,9 +30,11 @@ function GetMenus($userrank, $topos = 'main') | |||||
$dtp2->SetNameSpace('m', '<', '>'); | $dtp2->SetNameSpace('m', '<', '>'); | ||||
$m = 0; | $m = 0; | ||||
foreach ($dtp->CTags as $i => $ctag) { | foreach ($dtp->CTags as $i => $ctag) { | ||||
if ($ctag->GetName() == 'top' && ($ctag->GetAtt('rank') == '' || UserLogin::TestPurview($ctag->GetAtt('rank')))) { | |||||
if ($ctag->GetName() == 'top' && ($ctag->GetAtt('rank') == '' || TestPurview($ctag->GetAtt('rank')))) { | |||||
if ($openitem != 999 && !preg_match("#".$openitem.'_'."#", $ctag->GetAtt('item')) && $openitem != 100) continue; | if ($openitem != 999 && !preg_match("#".$openitem.'_'."#", $ctag->GetAtt('item')) && $openitem != 100) continue; | ||||
$htmp = str_replace("~channelname~", Lang($ctag->GetAtt("name")), $headTemplet); | |||||
$m++; | |||||
echo "<!--".($m + 1)."-->"; | |||||
$htmp = str_replace("~channelname~", $ctag->GetAtt("name"), $headTemplet); | |||||
if (empty($openitem) || $openitem == 100) { | if (empty($openitem) || $openitem == 100) { | ||||
if ($ctag->GetAtt('notshowall') == '1') continue; | if ($ctag->GetAtt('notshowall') == '1') continue; | ||||
$htmp = str_replace('~display~', $ctag->GetAtt('display'), $htmp); | $htmp = str_replace('~display~', $ctag->GetAtt('display'), $htmp); | ||||
@@ -43,21 +44,16 @@ function GetMenus($userrank, $topos = 'main') | |||||
else | else | ||||
$htmp = str_replace('~display~', 'none', $htmp); | $htmp = str_replace('~display~', 'none', $htmp); | ||||
} | } | ||||
$icon = 'fa-plug'; | |||||
if ($ctag->GetAtt('icon') != '') { | |||||
$icon = $ctag->GetAtt('icon'); | |||||
} | |||||
$htmp = str_replace('~icon~', $icon, $htmp); | |||||
$htmp = str_replace('~cc~', $m.'_'.$openitem, $htmp); | $htmp = str_replace('~cc~', $m.'_'.$openitem, $htmp); | ||||
echo $htmp; | echo $htmp; | ||||
$dtp2->LoadSource($ctag->InnerText); | $dtp2->LoadSource($ctag->InnerText); | ||||
foreach ($dtp2->CTags as $j => $ctag2) { | foreach ($dtp2->CTags as $j => $ctag2) { | ||||
$ischannel = trim($ctag2->GetAtt('ischannel')); | $ischannel = trim($ctag2->GetAtt('ischannel')); | ||||
if ($ctag2->GetName() == 'item' && ($ctag2->GetAtt('rank') == '' || UserLogin::TestPurview($ctag2->GetAtt('rank')))) { | |||||
$link = "<a href='".$ctag2->GetAtt('link')."' target='".$ctag2->GetAtt('target')."'>".Lang($ctag2->GetAtt('name'))."</a>"; | |||||
if ($ctag2->GetName() == 'item' && ($ctag2->GetAtt('rank') == '' || TestPurview($ctag2->GetAtt('rank')))) { | |||||
$link = "<a href='".$ctag2->GetAtt('link')."' target='".$ctag2->GetAtt('target')."'>".$ctag2->GetAtt('name')."</a>"; | |||||
if ($ischannel == '1') { | if ($ischannel == '1') { | ||||
if ($ctag2->GetAtt('addalt') != '') { | if ($ctag2->GetAtt('addalt') != '') { | ||||
$addalt = Lang($ctag2->GetAtt('addalt')); | |||||
$addalt = $ctag2->GetAtt('addalt'); | |||||
} else { | } else { | ||||
$addalt = '录入新内容'; | $addalt = '录入新内容'; | ||||
} | } | ||||
@@ -66,7 +62,10 @@ function GetMenus($userrank, $topos = 'main') | |||||
} else { | } else { | ||||
$addico = 'fa-plus-circle'; | $addico = 'fa-plus-circle'; | ||||
} | } | ||||
$link = "$link<a href='".$ctag2->GetAtt('linkadd')."' class='submenu-right' target='".$ctag2->GetAtt('target')."'><span class='fa $addico' title='$addalt'></span></a>"; | |||||
$link = "<div class='items'> | |||||
<div class='fllct'>$link</div> | |||||
<div class='flrct'><a href='".$ctag2->GetAtt('linkadd')."' target='".$ctag2->GetAtt('target')."'><i class='fa $addico' title='$addalt'></i></a></div> | |||||
</div>"; | |||||
} else { | } else { | ||||
$link .= ""; | $link .= ""; | ||||
} | } | ||||
@@ -75,6 +74,7 @@ function GetMenus($userrank, $topos = 'main') | |||||
} | } | ||||
} | } | ||||
echo $footTemplet; | echo $footTemplet; | ||||
echo "<!--".($m + 1)."-->"; | |||||
} | } | ||||
} | } | ||||
}//End Function | }//End Function |
@@ -2,7 +2,7 @@ | |||||
/** | /** | ||||
* 模块菜单 | * 模块菜单 | ||||
* | * | ||||
* @version $Id: inc_menu_module.php 2022-07-01 tianya $ | |||||
* @version $Id: inc_menu_module.php 1 10:32 2010年7月21日Z tianya $ | |||||
* @package DedeBIZ.Administrator | * @package DedeBIZ.Administrator | ||||
* @copyright Copyright (c) 2022, DedeBIZ.COM | * @copyright Copyright (c) 2022, DedeBIZ.COM | ||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
@@ -34,17 +34,17 @@ while ($row = $dsql->GetObject()) { | |||||
$plusset .= $row->menustring."\r\n"; | $plusset .= $row->menustring."\r\n"; | ||||
} | } | ||||
$adminMenu = ''; | $adminMenu = ''; | ||||
if ($cUserLogin->getUserType() >= 10) { | |||||
$adminMenu = DEDEBIZ_SAFE_MODE? "" : "<m:top name='module_main' c='6,' icon='fa-database'> | |||||
<m:item name='module_main' link='module_main.php' rank='sys_module' target='main' /> | |||||
<m:item name='module_upload' link='module_upload.php' rank='sys_module' target='main' /> | |||||
<m:item name='module_make' link='module_make.php' rank='sys_module' target='main' /> | |||||
if ($cuserLogin->getUserType() >= 10) { | |||||
$adminMenu = DEDEBIZ_SAFE_MODE? "" : "<m:top name='模块管理' c='6,' display='block'> | |||||
<m:item name='模块管理' link='module_main.php' rank='sys_module' target='main' /> | |||||
<m:item name='上传新模块' link='module_upload.php' rank='sys_module' target='main' /> | |||||
<m:item name='模块打包' link='module_make.php' rank='sys_module' target='main' /> | |||||
</m:top>"; | </m:top>"; | ||||
} | } | ||||
$menusMoudle = " | $menusMoudle = " | ||||
$adminMenu | $adminMenu | ||||
<m:top item='7' name='plus_main' icon='fa-plug'> | |||||
<m:item name='plus_main' link='plus_main.php' rank='10' target='main' /> | |||||
<m:top item='7' name='辅助插件' display='block'> | |||||
<m:item name='插件管理器' link='plus_main.php' rank='10' target='main' /> | |||||
$plusset | $plusset | ||||
</m:top> | </m:top> | ||||
$moduleset | $moduleset | ||||
@@ -15,6 +15,7 @@ if (preg_match("#PHP (.*) Development Server#", $_SERVER['SERVER_SOFTWARE'])) { | |||||
} | } | ||||
} | } | ||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
require_once(DEDEINC.'/dedetag.class.php'); | |||||
include(DEDEADMIN.'/templets/index.htm'); | include(DEDEADMIN.'/templets/index.htm'); | ||||
exit(); | exit(); | ||||
?> | ?> |
@@ -8,10 +8,9 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DedeBIZ; | |||||
use DedeBIZ\libraries\DedeStatistics; | |||||
require(dirname(__FILE__).'/config.php'); | require(dirname(__FILE__).'/config.php'); | ||||
helper('image'); | |||||
require(DEDEINC.'/image.func.php'); | |||||
require(DEDEINC.'/dedetag.class.php'); | |||||
//默认主页 | //默认主页 | ||||
if (empty($dopost)) { | if (empty($dopost)) { | ||||
require(DEDEINC.'/inc/inc_fun_funAdmin.php'); | require(DEDEINC.'/inc/inc_fun_funAdmin.php'); | ||||
@@ -32,7 +31,7 @@ else if ($dopost == 'setskin') { | |||||
} elseif ($dopost == 'get_seo') { | } elseif ($dopost == 'get_seo') { | ||||
//直接采用DedeBIZ重写方法 | //直接采用DedeBIZ重写方法 | ||||
exit; | exit; | ||||
} elseif ($dopost == 'get_articles'){ | |||||
} elseif($dopost == 'get_articles'){ | |||||
?> | ?> | ||||
<table class="table table-borderless"> | <table class="table table-borderless"> | ||||
<?php | <?php | ||||
@@ -45,20 +44,20 @@ else if ($dopost == 'setskin') { | |||||
} | } | ||||
?> | ?> | ||||
<?php | <?php | ||||
if (count($arcArr) > 1) | |||||
if(count($arcArr) > 1) | |||||
{ | { | ||||
foreach($arcArr as $row) | foreach($arcArr as $row) | ||||
{ | { | ||||
if (trim($row['editcon'])==''){ | |||||
if(trim($row['editcon'])==''){ | |||||
$row['editcon'] = 'archives_edit.php'; | $row['editcon'] = 'archives_edit.php'; | ||||
} | } | ||||
$rowarcrank = $row['arcrank']==-1? " <span class='text-danger'>[".Lang('not_approved')."]</span>":""; | |||||
$rowarcrank = $row['arcrank']==-1? " <span class='text-danger'>[未审核]</span>":""; | |||||
$pubdate = GetDateMk($row['pubdate']); | $pubdate = GetDateMk($row['pubdate']); | ||||
echo "<tr><td><a href='{$row['editcon']}?aid={$row['id']}&channelid={$row['channel']}'>{$row['title']}</a>{$rowarcrank}</td><td width='90'>{$pubdate}</td></tr>"; | echo "<tr><td><a href='{$row['editcon']}?aid={$row['id']}&channelid={$row['channel']}'>{$row['title']}</a>{$rowarcrank}</td><td width='90'>{$pubdate}</td></tr>"; | ||||
} | } | ||||
} else { | } else { | ||||
?> | ?> | ||||
<tr><td colspan="2"><?php echo Lang('admin_none_art');?></td></tr> | |||||
<tr><td colspan="2">暂无文档</td></tr> | |||||
<?php }?> | <?php }?> | ||||
</table> | </table> | ||||
<?php | <?php | ||||
@@ -67,7 +66,7 @@ else if ($dopost == 'setskin') { | |||||
if (!extension_loaded("openssl")) { | if (!extension_loaded("openssl")) { | ||||
echo json_encode(array( | echo json_encode(array( | ||||
"code" => -1001, | "code" => -1001, | ||||
"msg" => Lang('admin_auth_no_openssl'), | |||||
"msg" => "PHP不支持OpenSSL,无法完成商业版授权。", | |||||
"result" => null, | "result" => null, | ||||
)); | )); | ||||
exit; | exit; | ||||
@@ -75,7 +74,7 @@ else if ($dopost == 'setskin') { | |||||
if (empty($cfg_auth_code)) { | if (empty($cfg_auth_code)) { | ||||
echo json_encode(array( | echo json_encode(array( | ||||
"code" => -1002, | "code" => -1002, | ||||
"msg" => Lang('admin_auth_no_enabled'), | |||||
"msg" => "无法启动商业版组件<a href='https://www.dedebiz.com/auth'>《商业版授权》</a>", | |||||
"result" => null, | "result" => null, | ||||
)); | )); | ||||
exit; | exit; | ||||
@@ -83,7 +82,7 @@ else if ($dopost == 'setskin') { | |||||
openssl_public_decrypt(base64_decode($cfg_auth_code), $decotent, DEDEPUB); | openssl_public_decrypt(base64_decode($cfg_auth_code), $decotent, DEDEPUB); | ||||
$core_info = new stdClass; | $core_info = new stdClass; | ||||
if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { | ||||
$client = new DedeBIZ($cfg_bizcore_hostname, $cfg_bizcore_port); | |||||
$client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port); | |||||
$client->appid = $cfg_bizcore_appid; | $client->appid = $cfg_bizcore_appid; | ||||
$client->key = $cfg_bizcore_key; | $client->key = $cfg_bizcore_key; | ||||
$core_info = $client->SystemInfo(); | $core_info = $client->SystemInfo(); | ||||
@@ -98,7 +97,7 @@ else if ($dopost == 'setskin') { | |||||
"result" => array( | "result" => array( | ||||
"domain" => $res->domain, | "domain" => $res->domain, | ||||
"title" => $res->title, | "title" => $res->title, | ||||
"stype" => $res->stype == 1 ? Lang('company') : Lang('person'), | |||||
"stype" => $res->stype == 1 ? "企业单位" : "个人", | |||||
"auth_version" => $res->auth_version, | "auth_version" => $res->auth_version, | ||||
"auth_at" => date("Y-m-d", $res->auth_at), | "auth_at" => date("Y-m-d", $res->auth_at), | ||||
"core" => $core_info, | "core" => $core_info, | ||||
@@ -107,6 +106,7 @@ else if ($dopost == 'setskin') { | |||||
} | } | ||||
} | } | ||||
} elseif ($dopost == 'get_statistics') { | } elseif ($dopost == 'get_statistics') { | ||||
require_once(DEDEINC."/libraries/statistics.class.php"); | |||||
//获取统计信息 | //获取统计信息 | ||||
$sdate = empty($sdate) ? 0 : intval($sdate); | $sdate = empty($sdate) ? 0 : intval($sdate); | ||||
$stat = new DedeStatistics; | $stat = new DedeStatistics; | ||||
@@ -118,6 +118,7 @@ else if ($dopost == 'setskin') { | |||||
)); | )); | ||||
exit; | exit; | ||||
} elseif ($dopost == 'get_statistics_multi') { | } elseif ($dopost == 'get_statistics_multi') { | ||||
require_once(DEDEINC."/libraries/statistics.class.php"); | |||||
//获取统计信息 | //获取统计信息 | ||||
$sdates = empty($sdates) ? array() : explode(",",preg_replace("[^\d\,]","",$sdates)) ; | $sdates = empty($sdates) ? array() : explode(",",preg_replace("[^\d\,]","",$sdates)) ; | ||||
$stat = new DedeStatistics; | $stat = new DedeStatistics; | ||||
@@ -129,8 +130,8 @@ else if ($dopost == 'setskin') { | |||||
)); | )); | ||||
exit; | exit; | ||||
} elseif ($dopost == 'safe_mode') { | } elseif ($dopost == 'safe_mode') { | ||||
$safemsg = Lang('admin_safe_msg'); | |||||
$unsafemsg = Lang('admin_unsafe_msg'); | |||||
$safemsg = "系统环境运行模式为:安全模式,安全模式下无法使用“模板管理”、“标签管理”、“数据库管理”、“模块管理”等功能,如果您需要使用这些功能,在/system/common.inc.php文件中代码`DEDEBIZ_SAFE_MODE`后面值TRUE修改为FALSE"; | |||||
$unsafemsg = "系统环境运行模式为:非安全模式,系统“模板管理”、“标签管理”、“数据库管理”、“模块管理”等功能,存在一定安全风险,强烈建议,您在/system/common.inc.php文件中代码`DEDEBIZ_SAFE_MODE`后面值FALSE修改为TRUE"; | |||||
$modeStr = DEDEBIZ_SAFE_MODE? $safemsg : $unsafemsg; | $modeStr = DEDEBIZ_SAFE_MODE? $safemsg : $unsafemsg; | ||||
ShowMsg($modeStr, "javascript:;"); | ShowMsg($modeStr, "javascript:;"); | ||||
exit; | exit; | ||||
@@ -1,13 +1,4 @@ | |||||
<?php | <?php | ||||
/** | |||||
* 主页安全提示 | |||||
* | |||||
* @version $Id: index_testenv.php 1 8:48 2010年7月13日Z tianya $ | |||||
* @package DedeBIZ.Administrator | |||||
* @copyright Copyright (c) 2022, DedeBIZ.COM | |||||
* @license https://www.dedebiz.com/license | |||||
* @link https://www.dedebiz.com | |||||
*/ | |||||
@set_time_limit(0); | @set_time_limit(0); | ||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
AjaxHead(); | AjaxHead(); | ||||
@@ -92,7 +83,7 @@ if (!function_exists('TestAdminPWD')) { | |||||
{ | { | ||||
global $dsql; | global $dsql; | ||||
//查询栏目表确定栏目所在的目录 | //查询栏目表确定栏目所在的目录 | ||||
$sql = "SELECT usertype,userid,pwd FROM `#@__admin` WHERE `userid`='admin'"; | |||||
$sql = "SELECT usertype,userid,pwd FROM #@__admin WHERE `userid`='admin'"; | |||||
$row = $dsql->GetOne($sql); | $row = $dsql->GetOne($sql); | ||||
if (is_array($row)) { | if (is_array($row)) { | ||||
if ($row['pwd'] == 'f297a57a5a743894a0e4') { | if ($row['pwd'] == 'f297a57a5a743894a0e4') { | ||||
@@ -132,29 +123,29 @@ if (!function_exists('IsWritable')) { | |||||
$safeMsg = array(); | $safeMsg = array(); | ||||
$dirname = str_replace('index_body.php', '', strtolower($_SERVER['PHP_SELF'])); | $dirname = str_replace('index_body.php', '', strtolower($_SERVER['PHP_SELF'])); | ||||
if (preg_match("#[\\|/]admin[\\|/]#", $dirname)) { | if (preg_match("#[\\|/]admin[\\|/]#", $dirname)) { | ||||
$safeMsg[] = Lang('admin_testenv_admin'); | |||||
$safeMsg[] = '后台管理名称包默认名称admin,强烈建议您进行修改'; | |||||
} | } | ||||
if (IsWritable(DEDEDATA.'/common.inc.php')) { | if (IsWritable(DEDEDATA.'/common.inc.php')) { | ||||
$safeMsg[] = Lang('admin_testenv_writeable'); | |||||
$safeMsg[] = '数据配置data/common.inc.php文件,强烈建议以管理员权限设置禁止写入和执行'; | |||||
} | } | ||||
if (!IsSSL()) { | if (!IsSSL()) { | ||||
$safeMsg[] = Lang('admin_testenv_isssl'); | |||||
$safeMsg[] = '站点尚未启用HTTPS,强烈建议您配置HTTPS证书'; | |||||
} | } | ||||
if (version_compare(PHP_VERSION, '5.3.0', '<')) { | if (version_compare(PHP_VERSION, '5.3.0', '<')) { | ||||
$safeMsg[] = Lang('admin_testenv_phpver'); | |||||
$safeMsg[] = 'PHP版本过低会无法正常使用系统,强烈建议升级到PHP7.X'; | |||||
} | } | ||||
if (!DEDEBIZ_SAFE_MODE) { | if (!DEDEBIZ_SAFE_MODE) { | ||||
$safeMsg[] = Lang('admin_testenv_safemode'); | |||||
$safeMsg[] = '系统运行环境为:非安全模式,强烈建议启用安全模式 <a href="index_body.php?dopost=safe_mode" class="text-danger">[查看]</a>'; | |||||
} | } | ||||
$rs = TestAdminPWD(); | $rs = TestAdminPWD(); | ||||
if ($rs < 0) { | if ($rs < 0) { | ||||
$linkurl = '<a href="sys_admin_user.php" class="text-danger">['.Lang('edit').']</span>'; | |||||
$linkurl = '<a href="sys_admin_user.php" class="text-danger">[修改]</span>'; | |||||
switch ($rs) { | switch ($rs) { | ||||
case -1: | case -1: | ||||
$msg = Lang('admin_testenv_name',array('link'=>$linkurl)); | |||||
$msg = "默认管理员名称admin没有修改,建议您修改 {$linkurl}"; | |||||
break; | break; | ||||
case -2: | case -2: | ||||
$msg = Lang('admin_testenv_pwd',array('link'=>$linkurl)); | |||||
$msg = "默认管理员名称和密码没有修改,建议您修改 {$linkurl}"; | |||||
break; | break; | ||||
} | } | ||||
$safeMsg[] = $msg; | $safeMsg[] = $msg; | ||||
@@ -163,7 +154,7 @@ if ($rs < 0) { | |||||
<?php | <?php | ||||
if (count($safeMsg) > 0) { | if (count($safeMsg) > 0) { | ||||
?> | ?> | ||||
<div class="alert alert-danger mt-3 mb-3"> | |||||
<div class="alert alert-danger mt-3"> | |||||
<?php | <?php | ||||
$i = 1; | $i = 1; | ||||
foreach ($safeMsg as $key => $val) { | foreach ($safeMsg as $key => $val) { | ||||
@@ -174,4 +165,6 @@ if (count($safeMsg) > 0) { | |||||
} | } | ||||
?> | ?> | ||||
</div> | </div> | ||||
<?php }?> | |||||
<?php | |||||
} | |||||
?> |
@@ -95,7 +95,7 @@ function seePicNewAlb(f, imgdid, frname, hpos, acname) { | |||||
newobj.style.top = hpos; | newobj.style.top = hpos; | ||||
newobj.style.left = 100; | newobj.style.left = 100; | ||||
document.body.appendChild(newobj); | document.body.appendChild(newobj); | ||||
newobj.innerHTML = '<img src="../../static/web/img/load.gif"> 正在上传'; | |||||
newobj.innerHTML = '<img src="../../static/web/img/loadinglit.gif">'; | |||||
} | } | ||||
newobj.style.display = 'block'; | newobj.style.display = 'block'; | ||||
//提交后还原form的action等参数 | //提交后还原form的action等参数 | ||||
@@ -1543,7 +1543,7 @@ | |||||
var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker); | var toCmp = cmp(found.to, to) || extraRight(sp.marker) - extraRight(marker); | ||||
if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue } | if (fromCmp >= 0 && toCmp <= 0 || fromCmp <= 0 && toCmp >= 0) { continue } | ||||
if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) || | if (fromCmp <= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.to, from) >= 0 : cmp(found.to, from) > 0) || | ||||
fromCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0)) | |||||
FROMCmp >= 0 && (sp.marker.inclusiveRight && marker.inclusiveLeft ? cmp(found.from, to) <= 0 : cmp(found.from, to) < 0)) | |||||
{ return true } | { return true } | ||||
} } | } } | ||||
} | } | ||||
@@ -3423,10 +3423,10 @@ | |||||
if (viewport && viewport.ensure) { | if (viewport && viewport.ensure) { | ||||
var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line; | var ensureFrom = viewport.ensure.from.line, ensureTo = viewport.ensure.to.line; | ||||
if (ensureFrom < from) { | if (ensureFrom < from) { | ||||
from = ensureFrom; | |||||
FROM = ensureFrom; | |||||
to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight); | to = lineAtHeight(doc, heightAtLine(getLine(doc, ensureFrom)) + display.wrapper.clientHeight); | ||||
} else if (Math.min(ensureTo, doc.lastLine()) >= to) { | } else if (Math.min(ensureTo, doc.lastLine()) >= to) { | ||||
from = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight); | |||||
FROM = lineAtHeight(doc, heightAtLine(getLine(doc, ensureTo)) - display.wrapper.clientHeight); | |||||
to = ensureTo; | to = ensureTo; | ||||
} | } | ||||
} | } | ||||
@@ -4130,7 +4130,7 @@ | |||||
if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); } | if (display.viewFrom < from && from - display.viewFrom < 20) { from = Math.max(doc.first, display.viewFrom); } | ||||
if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); } | if (display.viewTo > to && display.viewTo - to < 20) { to = Math.min(end, display.viewTo); } | ||||
if (sawCollapsedSpans) { | if (sawCollapsedSpans) { | ||||
from = visualLineNo(cm.doc, from); | |||||
FROM = visualLineNo(cm.doc, from); | |||||
to = visualLineEndNo(cm.doc, to); | to = visualLineEndNo(cm.doc, to); | ||||
} | } | ||||
@@ -5276,7 +5276,7 @@ | |||||
function filterChange(doc, change, update) { | function filterChange(doc, change, update) { | ||||
var obj = { | var obj = { | ||||
canceled: false, | canceled: false, | ||||
from: change.from, | |||||
FROM: change.from, | |||||
to: change.to, | to: change.to, | ||||
text: change.text, | text: change.text, | ||||
origin: change.origin, | origin: change.origin, | ||||
@@ -5515,7 +5515,7 @@ | |||||
var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change"); | var changesHandler = hasHandler(cm, "changes"), changeHandler = hasHandler(cm, "change"); | ||||
if (changeHandler || changesHandler) { | if (changeHandler || changesHandler) { | ||||
var obj = { | var obj = { | ||||
from: from, to: to, | |||||
FROM: from, to: to, | |||||
text: change.text, | text: change.text, | ||||
removed: change.removed, | removed: change.removed, | ||||
origin: change.origin | origin: change.origin | ||||
@@ -5911,7 +5911,7 @@ | |||||
var line = this.lines[i]; | var line = this.lines[i]; | ||||
var span = getMarkedSpanFor(line.markedSpans, this); | var span = getMarkedSpanFor(line.markedSpans, this); | ||||
if (span.from != null) { | if (span.from != null) { | ||||
from = Pos(lineObj ? line : lineNo(line), span.from); | |||||
FROM = Pos(lineObj ? line : lineNo(line), span.from); | |||||
if (side == -1) { return from } | if (side == -1) { return from } | ||||
} | } | ||||
if (span.to != null) { | if (span.to != null) { | ||||
@@ -5989,7 +5989,7 @@ | |||||
} | } | ||||
if (marker.collapsed) { | if (marker.collapsed) { | ||||
if (conflictingCollapsedRange(doc, from.line, from, to, marker) || | if (conflictingCollapsedRange(doc, from.line, from, to, marker) || | ||||
from.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker)) | |||||
FROM.line != to.line && conflictingCollapsedRange(doc, to.line, from, to, marker)) | |||||
{ throw new Error("Inserting collapsed marker partially overlapping an existing one") } | { throw new Error("Inserting collapsed marker partially overlapping an existing one") } | ||||
seeCollapsedSpans(); | seeCollapsedSpans(); | ||||
} | } | ||||
@@ -6169,7 +6169,7 @@ | |||||
setSelection(this, simpleSelection(top), sel_dontScroll); | setSelection(this, simpleSelection(top), sel_dontScroll); | ||||
}), | }), | ||||
replaceRange: function(code, from, to, origin) { | replaceRange: function(code, from, to, origin) { | ||||
from = clipPos(this, from); | |||||
FROM = clipPos(this, from); | |||||
to = to ? clipPos(this, to) : from; | to = to ? clipPos(this, to) : from; | ||||
replaceRange(this, code, from, to, origin); | replaceRange(this, code, from, to, origin); | ||||
}, | }, | ||||
@@ -6413,7 +6413,7 @@ | |||||
return markers | return markers | ||||
}, | }, | ||||
findMarks: function(from, to, filter) { | findMarks: function(from, to, filter) { | ||||
from = clipPos(this, from); to = clipPos(this, to); | |||||
FROM = clipPos(this, from); to = clipPos(this, to); | |||||
var found = [], lineNo = from.line; | var found = [], lineNo = from.line; | ||||
this.iter(from.line, to.line + 1, function (line) { | this.iter(from.line, to.line + 1, function (line) { | ||||
var spans = line.markedSpans; | var spans = line.markedSpans; | ||||
@@ -6997,11 +6997,11 @@ | |||||
} | } | ||||
}); }, | }); }, | ||||
deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({ | deleteLine: function (cm) { return deleteNearSelection(cm, function (range) { return ({ | ||||
from: Pos(range.from().line, 0), | |||||
FROM: Pos(range.from().line, 0), | |||||
to: clipPos(cm.doc, Pos(range.to().line + 1, 0)) | to: clipPos(cm.doc, Pos(range.to().line + 1, 0)) | ||||
}); }); }, | }); }); }, | ||||
delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({ | delLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { return ({ | ||||
from: Pos(range.from().line, 0), to: range.from() | |||||
FROM: Pos(range.from().line, 0), to: range.from() | |||||
}); }); }, | }); }); }, | ||||
delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { | delWrappedLineLeft: function (cm) { return deleteNearSelection(cm, function (range) { | ||||
var top = cm.charCoords(range.head, "div").top + 5; | var top = cm.charCoords(range.head, "div").top + 5; | ||||
@@ -9073,11 +9073,11 @@ | |||||
var fromIndex, fromLine, fromNode; | var fromIndex, fromLine, fromNode; | ||||
if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) { | if (from.line == display.viewFrom || (fromIndex = findViewIndex(cm, from.line)) == 0) { | ||||
fromLine = lineNo(display.view[0].line); | |||||
fromNode = display.view[0].node; | |||||
FROMLine = lineNo(display.view[0].line); | |||||
FROMNode = display.view[0].node; | |||||
} else { | } else { | ||||
fromLine = lineNo(display.view[fromIndex].line); | |||||
fromNode = display.view[fromIndex - 1].node.nextSibling; | |||||
FROMLine = lineNo(display.view[fromIndex].line); | |||||
FROMNode = display.view[fromIndex - 1].node.nextSibling; | |||||
} | } | ||||
var toIndex = findViewIndex(cm, to.line); | var toIndex = findViewIndex(cm, to.line); | ||||
var toLine, toNode; | var toLine, toNode; | ||||
@@ -9254,7 +9254,7 @@ | |||||
for (;;) { | for (;;) { | ||||
walk(from); | walk(from); | ||||
if (from == to) { break } | if (from == to) { break } | ||||
from = from.nextSibling; | |||||
FROM = from.nextSibling; | |||||
extraLinebreak = false; | extraLinebreak = false; | ||||
} | } | ||||
return text | return text | ||||
@@ -23,7 +23,7 @@ function AlertMsg(title, id) { | |||||
titlecolor = "#254015";//标题颜色 | titlecolor = "#254015";//标题颜色 | ||||
titlebg = "#f8f8f8"; | titlebg = "#f8f8f8"; | ||||
//遮罩背景设置 | //遮罩背景设置 | ||||
content = "<div id=show_news>"+dedeLang('load_failed')+"</div>"; | |||||
content = "<div id=show_news>载入失败</div>"; | |||||
var sWidth, sHeight; | var sWidth, sHeight; | ||||
sWidth = screen.availWidth; | sWidth = screen.availWidth; | ||||
if (screen.availHeight > document.body.scrollHeight) { | if (screen.availHeight > document.body.scrollHeight) { | ||||
@@ -65,7 +65,7 @@ function AlertMsg(title, id) { | |||||
thObj.style.color = titlecolor; | thObj.style.color = titlecolor; | ||||
thObj.style.fontWeight = 'bold'; | thObj.style.fontWeight = 'bold'; | ||||
thObj.style.background = titlebg; | thObj.style.background = titlebg; | ||||
var titleStr = "<a class='close' onclick='CloseMsg()'>"+dedeLang('close')+"</a>" + "<span>" + title + "</span>"; | |||||
var titleStr = "<a class='close' onclick='CloseMsg()'>关闭</a>" + "<span>" + title + "</span>"; | |||||
thObj.innerHTML = titleStr; | thObj.innerHTML = titleStr; | ||||
//创建内容 | //创建内容 | ||||
var bodyObj = document.createElement("div"); | var bodyObj = document.createElement("div"); | ||||
@@ -14,7 +14,7 @@ function browserVersion(types) { | |||||
var matches = re.exec(USERAGENT); | var matches = re.exec(USERAGENT); | ||||
var ver = matches != null ? matches[2] : 0; | var ver = matches != null ? matches[2] : 0; | ||||
other = ver !== 0 ? 0 : other; | other = ver !== 0 ? 0 : other; | ||||
} else { | |||||
}else { | |||||
var ver = 0; | var ver = 0; | ||||
} | } | ||||
eval('BROWSER.' + i + '= ver'); | eval('BROWSER.' + i + '= ver'); | ||||
@@ -14,7 +14,7 @@ function addImage(src, pid) { | |||||
albImg++; | albImg++; | ||||
if (pid != 0) { | if (pid != 0) { | ||||
albImg = 'ok' + pid; | albImg = 'ok' + pid; | ||||
delstr = '<a href="javascript:delAlbPic(' + pid + ')" class="btn btn-success btn-sm">Lang("delete")</a>'; | |||||
delstr = '<a href="javascript:delAlbPic(' + pid + ')" class="btn btn-success btn-sm">删除</a>'; | |||||
} else { | } else { | ||||
albImg = 'err' + albImg; | albImg = 'err' + albImg; | ||||
} | } | ||||
@@ -25,8 +25,8 @@ function addImage(src, pid) { | |||||
if (typeof arctype != 'undefined' && arctype == 'article') { | if (typeof arctype != 'undefined' && arctype == 'article') { | ||||
iptwidth = 100; | iptwidth = 100; | ||||
if (pid != 0) { | if (pid != 0) { | ||||
newImgDiv.innerHTML = '<img src="' + src + '" onClick="addtoEdit(' + pid + ')">'+delstr; | |||||
newImgDiv.innerHTML = '<img src="' + src + '" onClick="addtoEdit(' + pid + ')">' + delstr; | |||||
} | } | ||||
} | } | ||||
newImgDiv.innerHTML += '<div class="mt-1">简介:<input type="text" name="picinfo' + albImg+ '" value="" style="width:' + iptwidth + 'px"></div>'; | |||||
newImgDiv.innerHTML += '<div class="mt-1">名称:<input type="text" name="picinfo' + albImg+ '" value="" style="width:' + iptwidth + 'px"></div>'; | |||||
} | } |
@@ -20,7 +20,7 @@ function DedeCopyToClipboard(text) { | |||||
} else { | } else { | ||||
var textarea = document.createElement('textarea'); | var textarea = document.createElement('textarea'); | ||||
document.body.appendChild(textarea); | document.body.appendChild(textarea); | ||||
//隐藏此输入框 | |||||
// 隐藏此输入框 | |||||
textarea.style.position = 'fixed'; | textarea.style.position = 'fixed'; | ||||
textarea.style.clip = 'rect(0 0 0 0)'; | textarea.style.clip = 'rect(0 0 0 0)'; | ||||
textarea.style.top = '10px'; | textarea.style.top = '10px'; | ||||
@@ -43,32 +43,33 @@ $(function () { | |||||
} | } | ||||
}); | }); | ||||
}); | }); | ||||
function copy(){ | |||||
function copyFn(){ | |||||
var val = document.getElementById('text'); | var val = document.getElementById('text'); | ||||
window.getSelection().selectAllChildren(val); | window.getSelection().selectAllChildren(val); | ||||
document.execCommand ("copy"); | |||||
document.execCommand ("Copy"); | |||||
//alert("成功复制系统信息"); | //alert("成功复制系统信息"); | ||||
} | } | ||||
//Dedebiz info | //Dedebiz info | ||||
var dedebizInfo; | var dedebizInfo; | ||||
function ViewDedeBIZ() { | function ViewDedeBIZ() { | ||||
console.log(dedebizInfo); | |||||
ShowMsg(` | ShowMsg(` | ||||
<table width="100%" class="table table-borderless"> | <table width="100%" class="table table-borderless"> | ||||
<tbody> | <tbody> | ||||
<tr> | <tr> | ||||
<td style="width:50%">版本号:</td> | |||||
<td width="160">版本号:</td> | |||||
<td>V${dedebizInfo.result.server_version}</td> | <td>V${dedebizInfo.result.server_version}</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td style="width:50%">运行时间:</td> | |||||
<td width="160">运行时间:</td> | |||||
<td>${dedebizInfo.result.server_run_time}</td> | <td>${dedebizInfo.result.server_run_time}</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td style="width:50%">服务器系统:</td> | |||||
<td width="160">服务器系统:</td> | |||||
<td>${dedebizInfo.result.server_goos}(${dedebizInfo.result.server_goarch})</td> | <td>${dedebizInfo.result.server_goos}(${dedebizInfo.result.server_goarch})</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td style="width:50%">内存占用:</td> | |||||
<td width="160">内存占用:</td> | |||||
<td>${dedebizInfo.result.server_memory_usage}%</td> | <td>${dedebizInfo.result.server_memory_usage}%</td> | ||||
</tr> | </tr> | ||||
</tbody> | </tbody> | ||||
@@ -83,32 +84,24 @@ function LoadServer() { | |||||
if (typeof rsp.result.domain !== "undefined") { | if (typeof rsp.result.domain !== "undefined") { | ||||
infoStr += ` | infoStr += ` | ||||
<tr> | <tr> | ||||
<td style="width:50%">`+dedeLang('admin_auth_domain')+`</td> | |||||
<td>${rsp.result.domain} <a href="${cfg_biz_dedebizUrl}/auth/?domain=${rsp.result.domain}" class="btn btn-success btn-sm">证书</a></td> | |||||
<td width="160">授权域名:</td> | |||||
<td>${rsp.result.domain}</td> | |||||
</tr> | </tr> | ||||
`; | `; | ||||
} | } | ||||
if (typeof rsp.result.title !== "undefined") { | if (typeof rsp.result.title !== "undefined") { | ||||
infoStr += ` | infoStr += ` | ||||
<tr> | <tr> | ||||
<td style="width:50%">`+dedeLang('admin_auth_sitename')+`</td> | |||||
<td>${rsp.result.title}</td> | |||||
</tr> | |||||
`; | |||||
} | |||||
if (typeof rsp.result.stype !== "undefined") { | |||||
infoStr += ` | |||||
<tr> | |||||
<td style="width:50%">`+dedeLang('admin_auth_sitetype')+`</td> | |||||
<td>${rsp.result.stype}</td> | |||||
<td width="160">站点名称:</td> | |||||
<td><a href="${cfg_biz_dedebizUrl}/auth/?domain=${rsp.result.domain}">${rsp.result.title}(${rsp.result.stype})</a></td> | |||||
</tr> | </tr> | ||||
`; | `; | ||||
} | } | ||||
if (typeof rsp.result.auth_version !== "undefined" && typeof rsp.result.auth_at !== "undefined") { | if (typeof rsp.result.auth_version !== "undefined" && typeof rsp.result.auth_at !== "undefined") { | ||||
infoStr += ` | infoStr += ` | ||||
<tr> | <tr> | ||||
<td style="width:50%">`+dedeLang('admin_auth_version')+`</td> | |||||
<td>V${rsp.result.auth_version}.x.x(`+dedeLang('time')+`:${rsp.result.auth_at})</td> | |||||
<td width="160">授权版本:</td> | |||||
<td>${rsp.result.auth_version}.x.x(时间:${rsp.result.auth_at})</td> | |||||
</tr> | </tr> | ||||
`; | `; | ||||
} | } | ||||
@@ -116,16 +109,16 @@ function LoadServer() { | |||||
//下面是DedeBIZ Core组件信息 | //下面是DedeBIZ Core组件信息 | ||||
infoStr += ` | infoStr += ` | ||||
<tr> | <tr> | ||||
<td style="width:50%">`+dedeLang('admin_auth_corever')+`</td> | |||||
<td><a href="${cfg_biz_dedebizUrl}/start?code=-1008" target="_blank" class="btn btn-danger btn-sm">`+dedeLang('admin_auth_enable_core')+`</a></td> | |||||
<td width="160">版本组件:</td> | |||||
<td><a href="${cfg_biz_dedebizUrl}/start?code=-1008" target="_blank" class="btn btn-warning btn-sm">启动组件</a></td> | |||||
</tr> | </tr> | ||||
`; | `; | ||||
} else { | } else { | ||||
dedebizInfo = JSON.parse(rsp.result.core.data); | dedebizInfo = JSON.parse(rsp.result.core.data); | ||||
infoStr += ` | infoStr += ` | ||||
<tr> | <tr> | ||||
<td style="width:50%">`+dedeLang('admin_auth_corever')+`</td> | |||||
<td><a href="javascript:ViewDedeBIZ()" class="btn btn-success btn-sm">`+dedeLang('admin_auth_core_info')+`</a></td> | |||||
<td width="160">版本组件:</td> | |||||
<td><a href="javascript:ViewDedeBIZ()" class="btn btn-success btn-sm">组件信息</a></td> | |||||
</tr> | </tr> | ||||
`; | `; | ||||
} | } | ||||
@@ -133,13 +126,13 @@ function LoadServer() { | |||||
$("#system-info").html(infoStr); | $("#system-info").html(infoStr); | ||||
} else { | } else { | ||||
$("#system-info").html(` | $("#system-info").html(` | ||||
<table class="table table-borderless"> | |||||
<table width="100%" class="table table-borderless"> | |||||
<tbody> | <tbody> | ||||
<tr> | <tr> | ||||
<td>`+dedeLang('admin_auth_no_bizcore')+`,${rsp.msg}</td> | |||||
<td>当前站点为社区版,${rsp.msg}</td> | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td>`+dedeLang('admin_auth_noauth_msg')+`</td> | |||||
<td>如果您已购买商业版授权,可以在我们的授权中心查询到相信关授权信息,如果查询结果与实际授权不符,则说明您可能购买了非法商业授权,请及时与我们取得联系。</td> | |||||
</tr> | </tr> | ||||
</tbody> | </tbody> | ||||
</table> | </table> | ||||
@@ -258,7 +251,7 @@ async function LoadStatChart() { | |||||
borderWidth: 1 | borderWidth: 1 | ||||
} | } | ||||
, { | , { | ||||
label: dedeLang('admin_stat_view'), | |||||
label: 'VV', | |||||
data: vvs, | data: vvs, | ||||
borderColor: 'rgba(75, 192, 192, 1)', | borderColor: 'rgba(75, 192, 192, 1)', | ||||
backgroundColor: 'rgba(75, 192, 192, 0.2)', | backgroundColor: 'rgba(75, 192, 192, 0.2)', | ||||
@@ -38,7 +38,7 @@ function moveArc(e, obj, cid){ | |||||
ShowMsg('必须选择一个或多个文档'); | ShowMsg('必须选择一个或多个文档'); | ||||
return; | return; | ||||
} | } | ||||
LoadQuickDiv(e, 'archives_do.php?dopost=moveArchives&qstr='+qstr+'&channelid='+cid+'&rnd='+Math.random(), 'moveArchives', '450px', '180px'); | |||||
LoadQuickDiv(e, 'archives_do.php?dopost=moveArchives&qstr='+qstr+'&channelid='+cid+'&rnd='+Math.random(), 'moveArchives', '460px', '180px'); | |||||
ChangeFullDiv('show'); | ChangeFullDiv('show'); | ||||
} | } | ||||
function adArc(aid){ | function adArc(aid){ | ||||
@@ -55,7 +55,7 @@ function cAtts(jname, e, obj) | |||||
ShowMsg('必须选择一个或多个文档'); | ShowMsg('必须选择一个或多个文档'); | ||||
return; | return; | ||||
} | } | ||||
LoadQuickDiv(e, 'archives_do.php?dopost=attsDlg&qstr='+qstr+'&dojob='+jname+'&rnd='+Math.random(), 'attsDlg', '450px', '180px'); | |||||
LoadQuickDiv(e, 'archives_do.php?dopost=attsDlg&qstr='+qstr+'&dojob='+jname+'&rnd='+Math.random(), 'attsDlg', '460px', '180px'); | |||||
ChangeFullDiv('show', screeheight); | ChangeFullDiv('show', screeheight); | ||||
} | } | ||||
function delArc(aid){ | function delArc(aid){ | ||||
@@ -102,7 +102,7 @@ function SeePicNew(f, imgdid, frname, hpos, acname) { | |||||
newobj.style.left = 100; | newobj.style.left = 100; | ||||
newobj.style.display = 'block'; | newobj.style.display = 'block'; | ||||
document.body.appendChild(newobj); | document.body.appendChild(newobj); | ||||
newobj.innerHTML = '<img src="../../static/web/img/load.gif">上传中...'; | |||||
newobj.innerHTML = '<img src="../../static/web/img/loadinglit.gif" alit="" />上传中...'; | |||||
} | } | ||||
newobj.style.display = 'block'; | newobj.style.display = 'block'; | ||||
//提交后还原form的action等参数 | //提交后还原form的action等参数 | ||||
@@ -177,6 +177,7 @@ function PutVote(str) { | |||||
parent.document.form1.voteid.value = str; | parent.document.form1.voteid.value = str; | ||||
tb_remove(true); | tb_remove(true); | ||||
} | } | ||||
} | } | ||||
function ClearDivCt(objname) { | function ClearDivCt(objname) { | ||||
if (!$Obj(objname)) return; | if (!$Obj(objname)) return; | ||||
@@ -212,7 +213,7 @@ function LoadNewDiv(e, surl, oname) { | |||||
if ($Nav() == 'IE') { | if ($Nav() == 'IE') { | ||||
var posLeft = window.event.clientX - 20; | var posLeft = window.event.clientX - 20; | ||||
var posTop = window.event.clientY - 30; | var posTop = window.event.clientY - 30; | ||||
//IE下scrollTop的兼容性问题 | |||||
// IE下scrollTop的兼容性问题 | |||||
var scrollTop = document.documentElement.scrollTop || window.pageYOffset; | var scrollTop = document.documentElement.scrollTop || window.pageYOffset; | ||||
if (typeof (scrollTop) == 'undefined') scrollTop = document.body.scrollTop; | if (typeof (scrollTop) == 'undefined') scrollTop = document.body.scrollTop; | ||||
posTop += scrollTop; | posTop += scrollTop; | ||||
@@ -313,10 +314,10 @@ function LoadQuickDiv(e, surl, oname, w, h) { | |||||
} | } | ||||
if (posTop > 500) posTop = 500; | if (posTop > 500) posTop = 500; | ||||
if (posLeft < 50) posLeft = 50; | if (posLeft < 50) posLeft = 50; | ||||
newobj.style.minWidth = "450px"; | |||||
newobj.style.minWidth = "460px"; | |||||
newobj.style.top = posTop + "px"; | newobj.style.top = posTop + "px"; | ||||
newobj.style.left = posLeft + "px"; | newobj.style.left = posLeft + "px"; | ||||
newobj.innerHTML = '<div style="margin-top:10px;margin-left:10px;"><img src="../../static/web/img/load.gif">Loading...</div>'; | |||||
newobj.innerHTML = '<img src="../../static/web/img/loadinglit.gif">'; | |||||
newobj.style.display = 'block'; | newobj.style.display = 'block'; | ||||
fetch(surl).then(resp => resp.text()).then((d) => { | fetch(surl).then(resp => resp.text()).then((d) => { | ||||
newobj.innerHTML = d; | newobj.innerHTML = d; | ||||
@@ -342,14 +343,14 @@ function getEvent() { | |||||
} | } | ||||
return null; | return null; | ||||
} | } | ||||
/* | |||||
模拟ondrop事件相关代码 | |||||
//模拟ondrop事件相关代码 | |||||
/*---------------------------- | |||||
leftLeaning = 300; | leftLeaning = 300; | ||||
如果对象内容固定,用onmousedown=DropStart去除底下的DropStop | 如果对象内容固定,用onmousedown=DropStart去除底下的DropStop | ||||
newobj.ondblclick = DropStart; | newobj.ondblclick = DropStart; | ||||
newobj.onmousemove = DropMove; | newobj.onmousemove = DropMove; | ||||
newobj.onmousedown = DropStop; | newobj.onmousedown = DropStop; | ||||
*/ | |||||
----------------------------*/ | |||||
function DropStart() { | function DropStart() { | ||||
this.style.cursor = 'move'; | this.style.cursor = 'move'; | ||||
} | } | ||||
@@ -370,12 +371,12 @@ function DropMove() { | |||||
this.style.top = posTop; | this.style.top = posTop; | ||||
this.style.left = posLeft - leftLeaning; | this.style.left = posLeft - leftLeaning; | ||||
} | } | ||||
/* | |||||
对指定的元素绑定move事件 | |||||
//对指定的元素绑定move事件 | |||||
/*----------------------------- | |||||
onmousemove="DropMoveHand('divname', 225);" | onmousemove="DropMoveHand('divname', 225);" | ||||
onmousedown="DropStartHand();" | onmousedown="DropStartHand();" | ||||
onmouseup="DropStopHand();" | onmouseup="DropStopHand();" | ||||
*/ | |||||
-----------------------------*/ | |||||
function DropStartHand() { | function DropStartHand() { | ||||
canMove = (canMove ? false : true); | canMove = (canMove ? false : true); | ||||
} | } | ||||
@@ -511,18 +512,18 @@ function guid() { | |||||
} | } | ||||
return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4()); | return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4()); | ||||
} | } | ||||
//函数会返回一个modalID,通过这个ID可自已定义一些方法 | |||||
//这里用到了一个展开语法 | |||||
//https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Spread_syntax | |||||
// 函数会返回一个modalID,通过这个ID可自已定义一些方法 | |||||
// 这里用到了一个展开语法 | |||||
// https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Spread_syntax | |||||
function ShowMsg(content, ...args) { | function ShowMsg(content, ...args) { | ||||
title = typeof dedeLang==="function"? dedeLang("msg_title") : '信息提示'; | |||||
title = "系统提示"; | |||||
size = ""; | size = ""; | ||||
if (typeof content == "undefined") content = ""; | if (typeof content == "undefined") content = ""; | ||||
modalID = guid(); | modalID = guid(); | ||||
var footer = `<button type="button" class="btn btn-primary" onClick="CloseModal(\'GKModal${modalID}\')">Ok</button>`; | var footer = `<button type="button" class="btn btn-primary" onClick="CloseModal(\'GKModal${modalID}\')">Ok</button>`; | ||||
var noClose = false; | var noClose = false; | ||||
if (args.length == 1) { | if (args.length == 1) { | ||||
//存在args参数 | |||||
// 存在args参数 | |||||
if (typeof args[0].title !== 'undefined' && args[0].title != "") { | if (typeof args[0].title !== 'undefined' && args[0].title != "") { | ||||
title = args[0].title; | title = args[0].title; | ||||
} | } | ||||
@@ -641,7 +642,7 @@ $(document).ready(function () { | |||||
litpicImgSrc = ""; | litpicImgSrc = ""; | ||||
litpicImg = ""; | litpicImg = ""; | ||||
$("#picname").val(litpicImg); | $("#picname").val(litpicImg); | ||||
$("#litPic").attr("src", "../../static/web/img/thumbnail.jpg"); | |||||
$("#litPic").attr("src", "../../static/web/img/defaultpic.jpg"); | |||||
}) | }) | ||||
//添加图片 | //添加图片 | ||||
$("#iptAddImages").change(function (event) { | $("#iptAddImages").change(function (event) { | ||||
@@ -688,7 +689,7 @@ $(document).ready(function () { | |||||
'"0><p>宽度:<span id="cropWidth"></span>px,高度:<span id="cropHeight"></span>px</p>' + optButton + '</div><div class="pv float-right" style="width:150px;height:100px;overflow:hidden;"></div></div>', { | '"0><p>宽度:<span id="cropWidth"></span>px,高度:<span id="cropHeight"></span>px</p>' + optButton + '</div><div class="pv float-right" style="width:150px;height:100px;overflow:hidden;"></div></div>', { | ||||
footer: footer, | footer: footer, | ||||
noClose: false, | noClose: false, | ||||
title: 'DedeBIZ缩略图裁剪', | |||||
title: '缩略图裁剪', | |||||
}); | }); | ||||
setTimeout(function () { | setTimeout(function () { | ||||
$("#cropImg" + mdlCropperID).cropper(optCropper); | $("#cropImg" + mdlCropperID).cropper(optCropper); | ||||
@@ -8,17 +8,16 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('sys_Log'); | |||||
CheckPurview('sys_Log'); | |||||
if (empty($dopost)) { | if (empty($dopost)) { | ||||
ShowMsg(Lang("log_list_err_noparms"), "javascript:;"); | |||||
ShowMsg("您没指定任何参数", "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
//清空所有日志 | //清空所有日志 | ||||
if ($dopost == "clear") { | if ($dopost == "clear") { | ||||
$dsql->ExecuteNoneQuery("DELETE FROM `#@__log`"); | |||||
ShowMsg(Lang("log_list_success_clearall"), "log_list.php"); | |||||
$dsql->ExecuteNoneQuery("DELETE FROM #@__log"); | |||||
ShowMsg("成功清空所有日志", "log_list.php"); | |||||
exit(); | exit(); | ||||
} else if ($dopost == "del") { | } else if ($dopost == "del") { | ||||
$bkurl = isset($_COOKIE['ENV_GOBACK_URL']) ? $_COOKIE['ENV_GOBACK_URL'] : "log_list.php"; | $bkurl = isset($_COOKIE['ENV_GOBACK_URL']) ? $_COOKIE['ENV_GOBACK_URL'] : "log_list.php"; | ||||
@@ -32,11 +31,11 @@ if ($dopost == "clear") { | |||||
} | } | ||||
} | } | ||||
if ($dquery != "") $dquery = " where ".$dquery; | if ($dquery != "") $dquery = " where ".$dquery; | ||||
$dsql->ExecuteNoneQuery("DELETE FROM `#@__log` $dquery"); | |||||
ShowMsg(Lang("content_delete_success"), $bkurl); | |||||
$dsql->ExecuteNoneQuery("DELETE FROM #@__log $dquery"); | |||||
ShowMsg("成功删除指定的日志", $bkurl); | |||||
exit(); | exit(); | ||||
} else { | } else { | ||||
ShowMsg(Lang("log_list_err_nomethod"), "javascript:;"); | |||||
ShowMsg("无法识别您的请求", "javascript:;"); | |||||
exit(); | exit(); | ||||
} | } | ||||
?> | ?> |
@@ -8,22 +8,21 @@ | |||||
* @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
* @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
*/ | */ | ||||
use DedeBIZ\libraries\DataListCP; | |||||
use DedeBIZ\Login\UserLogin; | |||||
require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
UserLogin::CheckPurview('sys_Log'); | |||||
CheckPurview('sys_Log'); | |||||
require_once(DEDEINC."/datalistcp.class.php"); | |||||
require_once(DEDEINC."/common.func.php"); | require_once(DEDEINC."/common.func.php"); | ||||
setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/"); | setcookie("ENV_GOBACK_URL", $dedeNowurl, time() + 3600, "/"); | ||||
$sql = $where = ""; | $sql = $where = ""; | ||||
if (empty($adminid)) $adminid = 0; | if (empty($adminid)) $adminid = 0; | ||||
if (empty($cip)) $cip = ""; | if (empty($cip)) $cip = ""; | ||||
if (empty($dtime)) $dtime = 0; | if (empty($dtime)) $dtime = 0; | ||||
if ($adminid > 0) $where .= " AND `#@__log`.adminid='$adminid' "; | |||||
if ($cip != "") $where .= " AND `#@__log`.cip LIKE '%$cip%' "; | |||||
if ($adminid > 0) $where .= " AND #@__log.adminid='$adminid' "; | |||||
if ($cip != "") $where .= " AND #@__log.cip LIKE '%$cip%' "; | |||||
if ($dtime > 0) { | if ($dtime > 0) { | ||||
$nowtime = time(); | $nowtime = time(); | ||||
$starttime = $nowtime - ($dtime * 24 * 3600); | $starttime = $nowtime - ($dtime * 24 * 3600); | ||||
$where .= " AND `#@__log`.dtime>'$starttime' "; | |||||
$where .= " AND #@__log.dtime>'$starttime' "; | |||||
} | } | ||||
$sql = "SELECT `#@__log`.*,`#@__admin`.userid FROM `#@__log` LEFT JOIN `#@__admin` ON `#@__admin`.id=`#@__log`.adminid WHERE 1=1 $where ORDER BY `#@__log`.lid DESC"; | $sql = "SELECT `#@__log`.*,`#@__admin`.userid FROM `#@__log` LEFT JOIN `#@__admin` ON `#@__admin`.id=`#@__log`.adminid WHERE 1=1 $where ORDER BY `#@__log`.lid DESC"; | ||||
$adminlist = ""; | $adminlist = ""; | ||||