diff --git a/src/data/admin/allowurl.txt b/src/data/admin/allowurl.txt
index 1a42fe45..73f28e44 100755
--- a/src/data/admin/allowurl.txt
+++ b/src/data/admin/allowurl.txt
@@ -1,4 +1,2 @@
www.dedebiz.com
-www.zhelixie.com
-www.dedecms.com
-bbs.dedecms.com
\ No newline at end of file
+www.zhelixie.com
\ No newline at end of file
diff --git a/src/data/admin/config_update.php b/src/data/admin/config_update.php
index 04048973..b993c434 100755
--- a/src/data/admin/config_update.php
+++ b/src/data/admin/config_update.php
@@ -1,7 +1,8 @@
Search();
include DedeInclude('templets/action_search.htm');
diff --git a/src/dede/actionsearch_class.php b/src/dede/actionsearch_class.php
index aa974728..fa96f8e4 100755
--- a/src/dede/actionsearch_class.php
+++ b/src/dede/actionsearch_class.php
@@ -1,12 +1,13 @@
asarray = $this->GetSearchstr();
$this->keyword = $keyword;
}
-
+
//初始化系统
- function ActionSearch($keyword){
+ function ActionSearch($keyword)
+ {
$this->__construct($keyword);
}
-
+
function GetSearchstr()
{
- require_once(dirname(__FILE__)."/inc/inc_action_info.php");
- return is_array($actionSearch)? $actionSearch : array();
+ require_once(dirname(__FILE__) . "/inc/inc_action_info.php");
+ return is_array($actionSearch) ? $actionSearch : array();
}
-
- function search(){
+
+ function search()
+ {
$this->searchkeyword();
return $this->result;
}
-
+
/**
* 遍历功能配置项进行关键词匹配
*
* @return void
*/
- function searchkeyword(){
+ function searchkeyword()
+ {
$i = 0; //数组序列索引
- foreach ($this->asarray as $key=>$value)
- {
+ foreach ($this->asarray as $key => $value) {
//对二级项目进行匹配
- if(is_array($this->asarray[$key]['soniterm']))
- {
- foreach ($this->asarray[$key]['soniterm'] as $k=> $val)
- {
+ if (is_array($this->asarray[$key]['soniterm'])) {
+ foreach ($this->asarray[$key]['soniterm'] as $k => $val) {
//进行权限判断
- if(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) {
//一级项目匹配
$this->result[$i]['toptitle'] = $this->redColorKeyword($this->asarray[$key]['toptitle']);
$this->result[$i]['title'] = $this->redColorKeyword($this->asarray[$key]['title']);
@@ -75,25 +74,24 @@ class ActionSearch
* @param string $text 关键词
* @return string
*/
- function redColorKeyword($text){
- if(is_array($text))
- {
+ function redColorKeyword($text)
+ {
+ if (is_array($text)) {
foreach ($text as $key => $value) {
- if($key == 'title' || $key == 'description')
- {
+ if ($key == 'title' || $key == 'description') {
//仅对title,description进行数组替换
- $text[$key] = str_replace($this->keyword,''.$this->keyword.'',$text[$key]);
- }
+ $text[$key] = str_replace($this->keyword, '' . $this->keyword . '', $text[$key]);
+ }
}
} else {
- $text = str_replace($this->keyword,''.$this->keyword.'',$text);
+ $text = str_replace($this->keyword, '' . $this->keyword . '', $text);
}
return $text;
}
-
- function _strpos($string,$find)
+
+ function _strpos($string, $find)
{
- if (function_exists('stripos')) return stripos($string,$find);
- return strpos($string,$find);
+ if (function_exists('stripos')) return stripos($string, $find);
+ return strpos($string, $find);
}
-}
\ No newline at end of file
+}
diff --git a/src/dede/ad_add.php b/src/dede/ad_add.php
index 664b3659..54ce80d4 100755
--- a/src/dede/ad_add.php
+++ b/src/dede/ad_add.php
@@ -1,78 +1,58 @@
GetOne("SELECT typeid FROM #@__myad WHERE typeid='$typeid' AND tagname LIKE '$tagname'");
- if(is_array($row))
- {
- ShowMsg("在相同栏目下已经存在同名的标记!","-1");
+ if (is_array($row)) {
+ ShowMsg("在相同栏目下已经存在同名的标记!", "-1");
exit();
}
$starttime = GetMkTime($starttime);
$endtime = GetMkTime($endtime);
$link = addslashes($normbody['link']);
- if($normbody['style']=='code')
- {
+ if ($normbody['style'] == 'code') {
$normbody = addslashes($normbody['htmlcode']);
- }
- else if($normbody['style']=='txt')
- {
-
+ } else if ($normbody['style'] == 'txt') {
+
$normbody = "{$normbody['title']}";
- }
- else if($normbody['style']=='img')
- {
- if(empty($normbody['width']))
- {
+ } else if ($normbody['style'] == 'img') {
+ if (empty($normbody['width'])) {
$width = "";
- }
- else
- {
+ } else {
$width = " width=\"{$normbody['width']}\"";
}
- if (empty($normbody['height']))
- {
+ if (empty($normbody['height'])) {
$height = "";
- }
- else
- {
+ } else {
$height = "height=\"{$normbody['height']}\"";
}
$normbody = "";
- }
- else
- {
- if(empty($normbody['width']))
- {
+ } else {
+ if (empty($normbody['width'])) {
$width = "";
- }
- else
- {
+ } else {
$width = " width=\"{$normbody['width']}\"";
}
- if (empty($normbody['height']))
- {
+ if (empty($normbody['height'])) {
$height = "";
- }
- else
- {
+ } else {
$height = "height=\"{$normbody['height']}\"";
}
$normbody = "";
@@ -82,17 +62,16 @@ if($dopost=="save")
VALUES('$clsid','$typeid','$tagname','$adname','$timeset','$starttime','$endtime','$normbody','$expbody');
";
$dsql->ExecuteNoneQuery($query);
- ShowMsg("成功增加一个广告!","ad_main.php");
+ ShowMsg("成功增加一个广告!", "ad_main.php");
exit();
}
-$dsql->Execute('dd','SELECT * FROM `#@__myadtype` ORDER BY id DESC');
+$dsql->Execute('dd', 'SELECT * FROM `#@__myadtype` ORDER BY id DESC');
$option = '';
-while($arr = $dsql->GetArray('dd'))
-{
+while ($arr = $dsql->GetArray('dd')) {
$option .= "\n\r";
}
$startDay = time();
-$endDay = AddDay($startDay,30);
+$endDay = AddDay($startDay, 30);
$startDay = GetDateTimeMk($startDay);
$endDay = GetDateTimeMk($endDay);
-include DedeInclude('templets/ad_add.htm');
\ No newline at end of file
+include DedeInclude('templets/ad_add.htm');
diff --git a/src/dede/ad_edit.php b/src/dede/ad_edit.php
index 1f8c4224..9be3fe30 100755
--- a/src/dede/ad_edit.php
+++ b/src/dede/ad_edit.php
@@ -1,35 +1,33 @@
ExecuteNoneQuery("DELETE FROM `#@__myad` WHERE aid='$aid' ");
- ShowMsg("成功删除一则广告代码!",$ENV_GOBACK_URL);
+ ShowMsg("成功删除一则广告代码!", $ENV_GOBACK_URL);
exit();
-}
-else if($dopost=="gettag")
-{
- require_once(DEDEINC.'/oxwindow.class.php');
+} else if ($dopost == "gettag") {
+ require_once(DEDEINC . '/oxwindow.class.php');
$jscode = "";
$showhtml = "
\r\n";
@@ -350,55 +318,49 @@ else if($dopost=='moveArchives')
echo "
\r\n";
echo "
-
-
+
目标栏目: |
+
+
+ |
+
+
+ 文档ID: |
+
+
+
+ 移动到的目标栏目必须和选定的文档频道类型一致,否则程序会自动勿略不符合的文档。
+ |
+
+
+
+
+
+
+ |
+
+
+
+
+ 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";
- if(!is_array($typeInfos))
- {
- ShowMsg('参数错误!','-1');
+ if (!is_array($typeInfos)) {
+ ShowMsg('参数错误!', '-1');
exit();
}
- if($typeInfos['ispart']!=0)
- {
- ShowMsg('文档保存的栏目必须为最终列表栏目!','-1');
+ if ($typeInfos['ispart'] != 0) {
+ ShowMsg('文档保存的栏目必须为最终列表栏目!', '-1');
exit();
}
- if(empty($typeInfos['addtable']))
- {
+ if (empty($typeInfos['addtable'])) {
$typeInfos['maintable'] = '#@__archives';
}
//增加单表模型判断
- if($typeInfos['issystem'] == -1)
- {
+ if ($typeInfos['issystem'] == -1) {
$typeInfos['maintable'] = $typeInfos['addtable'];
$idtype = "aid";
}
@@ -408,10 +370,8 @@ else if($dopost=='moveArchives')
$okids = array();
$dsql->SetQuery("SELECT {$idtype},typeid FROM `{$typeInfos['maintable']}` WHERE {$idtype} in($arcids) AND channel='{$typeInfos['channeltype']}' ");
$dsql->Execute();
- while($row = $dsql->GetArray())
- {
- if($row['typeid']!=$totype)
- {
+ while ($row = $dsql->GetArray()) {
+ 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]}' ");
@@ -420,8 +380,7 @@ else if($dopost=='moveArchives')
}
}
//更新HTML
- foreach($okids as $aid)
- {
+ foreach ($okids as $aid) {
$arc = new Archives($aid);
$arc->MakeHtml();
}
@@ -432,89 +391,73 @@ else if($dopost=='moveArchives')
/*-----------------------------
//还原文档
function RbReturnArchives(){ }
-------------------------------*/
-else if($dopost=='return')
-{
+------------------------------*/ else if ($dopost == 'return') {
CheckPurview('a_Del,a_AccDel,a_MyDel,sys_ArcBatch');
- require_once(DEDEINC."/oxwindow.class.php");
+ require_once(DEDEINC . "/oxwindow.class.php");
- if( !empty($aid) && empty($qstr) ) $qstr = $aid;
+ if (!empty($aid) && empty($qstr)) $qstr = $aid;
- if($qstr=='')
- {
- ShowMsg("参数无效!","recycling.php");
+ if ($qstr == '') {
+ ShowMsg("参数无效!", "recycling.php");
exit();
}
$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 `#@__arctiny` SET `arcrank` = '-1' WHERE id = '$aid'; ");
}
- ShowMsg("成功还原指定的文档!","recycling.php");
+ ShowMsg("成功还原指定的文档!", "recycling.php");
exit();
}
/*-----------------------------
//清空文档
function RbClearArchives(){ }
-------------------------------*/
-else if($dopost=='clear')
-{
+------------------------------*/ else if ($dopost == 'clear') {
CheckPurview('a_Del,a_AccDel,a_MyDel,sys_ArcBatch');
- require_once(DEDEINC."/oxwindow.class.php");
- if(empty($fmdo)) $fmdo = '';
- $recycle = empty($recycle)? "" : $recycle;
+ require_once(DEDEINC . "/oxwindow.class.php");
+ if (empty($fmdo)) $fmdo = '';
+ $recycle = empty($recycle) ? "" : $recycle;
- if($fmdo=='yes')
- {
- if( !empty($aid) && empty($qstr) ) $qstr = $aid;
- if($qstr=='')
- {
- ShowMsg("参数无效!","recycling.php");
+ if ($fmdo == 'yes') {
+ if (!empty($aid) && empty($qstr)) $qstr = $aid;
+ if ($qstr == '') {
+ ShowMsg("参数无效!", "recycling.php");
exit();
}
$qstrs = explode(",", $qstr);
- $okaids = Array();
- foreach($qstrs as $qstr)
- {
- if(!isset($okaids[$qstr]))
- {
+ $okaids = array();
+ foreach ($qstrs as $qstr) {
+ if (!isset($okaids[$qstr])) {
DelArc($qstr, "OK", FALSE, $recycle);
$okaids[$qstr] = $qstr;
- }
- else
- {
+ } else {
$okaids[$qstr] = 1;
}
}
- ShowMsg("成功删除指定的文档!","recycling.php");
+ ShowMsg("成功删除指定的文档!", "recycling.php");
exit();
- }
- else
- {
+ } else {
$dsql->SetQuery("SELECT id FROM `#@__archives` WHERE `arcrank` = '-2'");
$dsql->Execute();
$qstr = '';
- while($row = $dsql->GetArray())
- {
- $qstr .= $row['id'].",";
+ while ($row = $dsql->GetArray()) {
+ $qstr .= $row['id'] . ",";
$aid = $row['id'];
}
$num = $dsql->GetTotalRow();
- if(empty($num))
- {
- ShowMsg("对不起,未发现相关文档!","recycling.php");
+ if (empty($num)) {
+ ShowMsg("对不起,未发现相关文档!", "recycling.php");
exit();
}
$wintitle = "文档管理-清空所有文档";
$wecome_info = "
文档回收站::清空所有文档";
$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->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 篇文档你确实要永久删除“ $qstr ”这些文档?");
$winform = $win->GetWindow("ok");
$win->Display();
@@ -523,51 +466,40 @@ else if($dopost=='clear')
/*-----------------------------
//清除文档
function RbDelArchives(){ }
-------------------------------*/
-else if($dopost=='del')
-{
+------------------------------*/ else if ($dopost == 'del') {
CheckPurview('a_Del,a_AccDel,a_MyDel,sys_ArcBatch');
- require_once(DEDEINC."/oxwindow.class.php");
- if(empty($fmdo)) $fmdo = '';
- $recycle = empty($recycle)? "" : $recycle;
+ require_once(DEDEINC . "/oxwindow.class.php");
+ if (empty($fmdo)) $fmdo = '';
+ $recycle = empty($recycle) ? "" : $recycle;
- if($fmdo=='yes')
- {
- if( !empty($aid) && empty($qstr) ) $qstr = $aid;
- if($qstr=='')
- {
- ShowMsg("参数无效!","recycling.php");
+ if ($fmdo == 'yes') {
+ if (!empty($aid) && empty($qstr)) $qstr = $aid;
+ if ($qstr == '') {
+ ShowMsg("参数无效!", "recycling.php");
exit();
}
$qstrs = explode("`", $qstr);
- $okaids = Array();
+ $okaids = array();
- foreach($qstrs as $aid)
- {
- if(!isset($okaids[$aid]))
- {
- DelArc($aid,"OK","",$recycle);
- }
- else
- {
+ foreach ($qstrs as $aid) {
+ if (!isset($okaids[$aid])) {
+ DelArc($aid, "OK", "", $recycle);
+ } else {
$okaids[$aid] = 1;
}
}
- ShowMsg("成功删除指定的文档!","recycling.php");
+ ShowMsg("成功删除指定的文档!", "recycling.php");
exit();
- }
-
- else
- {
+ } else {
$wintitle = "文档管理-删除文档";
$wecome_info = "
文档管理::删除文档";
$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->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 和 $aid ”这些文档?");
$winform = $win->GetWindow("ok");
$win->Display();
@@ -576,10 +508,8 @@ else if($dopost=='del')
/*-----------------------------
//快速编辑
function quickEdit(){ }
-------------------------------*/
-else if($dopost=='quickEdit')
-{
- require_once(DEDEADMIN."/inc/inc_catalog_options.php");
+------------------------------*/ else if ($dopost == 'quickEdit') {
+ require_once(DEDEADMIN . "/inc/inc_catalog_options.php");
AjaxHead();
$query = "SELECT ch.typename as channelname,ch.addtable,ar.membername as rankname,arc.*
FROM `#@__archives` arc
@@ -595,127 +525,119 @@ else if($dopost=='quickEdit')
echo "
\r\n";
echo "
\r\n";
echo "
-
+ $dsql->SetQuery("SELECT * FROM `#@__arcrank` WHERE adminrank<='$urank'");
+ $dsql->Execute();
+ while ($row = $dsql->GetObject()) {
+ echo "
\r\n";
+ }
+ ?>
+
+ 需要金币:
" style="width:80px" />
+
+
+
+ 关键字: |
+
+
+ |
+
+
+
+
+
+
+ |
+
+
+
+
getUserID());
}
}
$title = dede_htmlspecialchars(cn_substrR($title, $cfg_title_maxlen));
$shorttitle = cn_substrR($shorttitle, 36);
$keywords = trim(cn_substrR($keywords, 60));
- if(!TestPurview('a_Check,a_AccCheck,a_MyCheck')) $arcrank = -1;
+ if (!TestPurview('a_Check,a_AccCheck,a_MyCheck')) $arcrank = -1;
$adminid = $cuserLogin->getUserID();
-
+
//属性处理
$flag = isset($flags) ? join(',', $flags) : '';
- if(!empty($flag))
- {
- if(preg_match("#p#", $oldflag)) $flag .= ',p';
- if(preg_match("#j#", $oldflag)) $flag .= ',j';
+ if (!empty($flag)) {
+ if (preg_match("#p#", $oldflag)) $flag .= ',p';
+ if (preg_match("#j#", $oldflag)) $flag .= ',j';
}
- /*
+ /*
else
{
$flag = $oldflag;
}
*/
-
+
$query = "UPDATE `#@__archives` SET
typeid = '$typeid',
flag = '$flag',
@@ -731,31 +653,27 @@ else if($dopost=='quickEditSave')
//更新微表
$dsql->ExecuteNoneQuery(" UPDATE `#@__arctiny` SET typeid='$typeid',arcrank='$arcrank' WHERE id='$aid' ");
//更新附加表
- if($typeid != $oldtypeid)
- {
+ if ($typeid != $oldtypeid) {
$addtable = trim($addtable);
- if(empty($addtable)) $addtable = '#@__addonarticle';
+ if (empty($addtable)) $addtable = '#@__addonarticle';
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);
- $backurl = !empty($_COOKIE['ENV_GOBACK_URL']) ? $_COOKIE['ENV_GOBACK_URL'] : '-1';
- ShowMsg('成功更新一篇文档的基本信息!', $backurl);
- exit();
+ $backurl = !empty($_COOKIE['ENV_GOBACK_URL']) ? $_COOKIE['ENV_GOBACK_URL'] : '-1';
+ ShowMsg('成功更新一篇文档的基本信息!', $backurl);
+ exit();
}
/*--------------------------
分析并自动获取文档关键词
function makekw(){ }
---------------------------*/
-else if($dopost=="makekw")
-{
+--------------------------*/ else if ($dopost == "makekw") {
CheckPurview('a_Commend,sys_ArcBatch');
- if( !empty($aid) && empty($qstr) ) $qstr = $aid;
+ if (!empty($aid) && empty($qstr)) $qstr = $aid;
- if($qstr=='')
- {
+ if ($qstr == '') {
ShowMsg("参数无效!", $ENV_GOBACK_URL);
exit();
}
@@ -769,16 +687,15 @@ else if($dopost=="makekw")
$client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port);
$client->appid = $cfg_bizcore_appid;
$client->key = $cfg_bizcore_key;
- while($row = $dsql->GetArray())
- {
+ while ($row = $dsql->GetArray()) {
//跳过已经有关键字的内容
- if(trim($row['keywords']) !='' ) continue;
+ if (trim($row['keywords']) != '') continue;
$aid = $row['id'];
$keywords = '';
$title = $row['title'];
$description = $row['description'];
$body = cn_substr($row['body'], 5000);
- $data = $client->Spliteword($title.Html2Text($body));
+ $data = $client->Spliteword($title . Html2Text($body));
$keywords = $data->data;
$description = str_replace(' ', ' ', trim($description));
$description = str_replace('[', ' ', $description);
@@ -791,13 +708,12 @@ else if($dopost=="makekw")
}
$client->Close();
} else {
- include_once(DEDEINC.'/splitword.class.php');
+ include_once(DEDEINC . '/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;
+
$aid = $row['id'];
$keywords = '';
$title = $row['title'];
@@ -805,39 +721,30 @@ else if($dopost=="makekw")
$body = cn_substr($row['body'], 5000);
$sp->SetSource($title, $cfg_soft_lang, $cfg_soft_lang);
$sp->StartAnalysis();
- $titleindexs = preg_replace("/#p#|#e#/",'',$sp->GetFinallyIndex());
+ $titleindexs = preg_replace("/#p#|#e#/", '', $sp->GetFinallyIndex());
$sp->SetSource(Html2Text($body), $cfg_soft_lang, $cfg_soft_lang);
$sp->StartAnalysis();
- $allindexs = preg_replace("/#p#|#e#/",'',$sp->GetFinallyIndex());
-
- if(is_array($allindexs) && is_array($titleindexs))
- {
- foreach($titleindexs as $k => $v)
- {
- if(strlen($keywords.$k)>=60)
- {
+ $allindexs = preg_replace("/#p#|#e#/", '', $sp->GetFinallyIndex());
+
+ if (is_array($allindexs) && is_array($titleindexs)) {
+ foreach ($titleindexs as $k => $v) {
+ if (strlen($keywords . $k) >= 60) {
break;
- }
- else
- {
- if(strlen($k) <= 2) continue;
- $keywords .= $k.',';
+ } else {
+ if (strlen($k) <= 2) continue;
+ $keywords .= $k . ',';
}
}
- foreach($allindexs as $k => $v)
- {
- if(strlen($keywords.$k)>=60)
- {
+ foreach ($allindexs as $k => $v) {
+ if (strlen($keywords . $k) >= 60) {
break;
- }
- else if(!in_array($k,$titleindexs))
- {
- if(strlen($k) <= 2) continue;
- $keywords .= $k.',';
+ } else if (!in_array($k, $titleindexs)) {
+ if (strlen($k) <= 2) continue;
+ $keywords .= $k . ',';
}
}
}
-
+
$description = str_replace(' ', ' ', trim($description));
$description = str_replace('[', ' ', $description);
$description = str_replace(']', ' ', $description);
@@ -857,20 +764,16 @@ else if($dopost=="makekw")
/*--------------------------
//批量增加属性
function attsAdd(){ }
----------------------------*/
-else if($dopost=='attsAdd')
-{
+---------------------------*/ else if ($dopost == 'attsAdd') {
CheckPurview('a_Commend,sys_ArcBatch');
- if( !empty($aid) && empty($qstr) ) $qstr = $aid;
+ if (!empty($aid) && empty($qstr)) $qstr = $aid;
- if($qstr=='')
- {
- ShowMsg("参数无效!",$ENV_GOBACK_URL);
+ if ($qstr == '') {
+ ShowMsg("参数无效!", $ENV_GOBACK_URL);
exit();
}
- if(empty($flagname))
- {
- ShowMsg("必须指定要添加的属性!",$ENV_GOBACK_URL);
+ if (empty($flagname)) {
+ ShowMsg("必须指定要添加的属性!", $ENV_GOBACK_URL);
exit();
}
$arcids = preg_replace("#[^0-9,]#", '', preg_replace("#`#", ',', $qstr));
@@ -880,42 +783,34 @@ else if($dopost=='attsAdd')
WHERE arc.id in($arcids) ";
$dsql->SetQuery($query);
$dsql->Execute();
- while($row = $dsql->GetArray())
- {
+ while ($row = $dsql->GetArray()) {
$aid = $row['id'];
- if($row['issystem'] != -1)
- {
- $maintable = ( trim($row['maintable'])=='' ? '#@__archives' : trim($row['maintable']) );
+ if ($row['issystem'] != -1) {
+ $maintable = (trim($row['maintable']) == '' ? '#@__archives' : trim($row['maintable']));
$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}' ");
- }
- else
- {
+ } else {
$maintable = trim($row['addtable']);
$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}' ");
}
}
- ShowMsg("成功对选中文档增加指定的属性!",$ENV_GOBACK_URL);
+ ShowMsg("成功对选中文档增加指定的属性!", $ENV_GOBACK_URL);
exit();
}
/*--------------------------
//批量删除属性
function attsDel(){ }
----------------------------*/
-else if($dopost=='attsDel')
-{
+---------------------------*/ else if ($dopost == 'attsDel') {
CheckPurview('a_Commend,sys_ArcBatch');
- if( !empty($aid) && empty($qstr) ) $qstr = $aid;
- if($qstr=='')
- {
+ if (!empty($aid) && empty($qstr)) $qstr = $aid;
+ if ($qstr == '') {
ShowMsg("参数无效!", $ENV_GOBACK_URL);
exit();
}
- if(empty($flagname))
- {
+ if (empty($flagname)) {
ShowMsg("必须指定要删除的属性!", $ENV_GOBACK_URL);
exit();
}
@@ -926,33 +821,25 @@ else if($dopost=='attsDel')
WHERE arc.id in($arcids) ";
$dsql->SetQuery($query);
$dsql->Execute();
- while($row = $dsql->GetArray())
- {
+ while ($row = $dsql->GetArray()) {
$aid = $row['id'];
- if($row['issystem'] != -1)
- {
+ if ($row['issystem'] != -1) {
$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' ");
- }
- else
- {
+ } else {
$idname = 'aid';
$maintable = trim($row['addtable']);
$arr = $dsql->GetOne("SELECT flag FROM `{$maintable}` WHERE aid='$aid' ");
}
$flag = $arr['flag'];
- if(trim($flag)=='' || !preg_match("#".$flagname."#", $flag) )
- {
+ if (trim($flag) == '' || !preg_match("#" . $flagname . "#", $flag)) {
continue;
- }
- else
- {
+ } else {
$flags = explode(',', $flag);
$okflags = array();
- foreach($flags as $f)
- {
- if($f != $flagname) $okflags[] = $f;
+ foreach ($flags as $f) {
+ if ($f != $flagname) $okflags[] = $f;
}
}
$flag = trim(join(',', $okflags));
@@ -964,12 +851,10 @@ else if($dopost=='attsDel')
/*--------------------------
//获得批量属性处理的AJAX窗体
function attsDlg(){ }
----------------------------*/
-else if($dopost=='attsDlg')
-{
- if( !empty($aid) && empty($qstr) ) $qstr = $aid;
+---------------------------*/ else if ($dopost == 'attsDlg') {
+ if (!empty($aid) && empty($qstr)) $qstr = $aid;
- $dojobname = ($dojob=='attsDel' ? '批量删除属性' : '批量增加属性');
+ $dojobname = ($dojob == 'attsDel' ? '批量删除属性' : '批量增加属性');
AjaxHead();
//输出AJAX可移动窗体
$divname = 'attsDlg';
@@ -982,46 +867,43 @@ else if($dopost=='attsDlg')
echo "
\r\n";
echo "
-
+
+ 属 性: |
+
+ ' />
+ SetQuery("SELECT * FROM `#@__arcatt` ORDER BY sortid ASC");
+ $dsql->Execute();
+ while ($trow = $dsql->GetObject()) {
+ if ($trow->att == 'j' || $trow->att == 'p') continue;
+ echo "";
+ }
+ ?>
+ |
+
+
+ 文档ID: |
+
+
+ |
+
+
+
+
+
+
+ |
+
+
+
+
\r\n";
$tus = new TypeUnitSelector();
?>
-
+
\ No newline at end of file
diff --git a/src/dede/archives_edit.php b/src/dede/archives_edit.php
index b0d66758..05436369 100755
--- a/src/dede/archives_edit.php
+++ b/src/dede/archives_edit.php
@@ -1,24 +1,24 @@
GetOne($arcQuery);
- if(!is_array($arcRow))
- {
- ShowMsg("读取档案基本信息出错!","-1");
+ if (!is_array($arcRow)) {
+ ShowMsg("读取档案基本信息出错!", "-1");
exit();
}
- $query = "SELECT * FROM `#@__channeltype` WHERE id='".$arcRow['channel']."'";
+ $query = "SELECT * FROM `#@__channeltype` WHERE id='" . $arcRow['channel'] . "'";
$cInfos = $dsql->GetOne($query);
- if(!is_array($cInfos))
- {
- ShowMsg("读取频道配置信息出错!","javascript:;");
+ if (!is_array($cInfos)) {
+ ShowMsg("读取频道配置信息出错!", "javascript:;");
exit();
}
$addtable = $cInfos['addtable'];
@@ -52,53 +50,44 @@ if($dopost!='save')
}
/*--------------------------------
function __save(){ }
--------------------------------*/
-else if($dopost=='save')
-{
- require_once(DEDEINC.'/image.func.php');
- require_once(DEDEINC.'/oxwindow.class.php');
- $flag = isset($flags) ? join(',',$flags) : '';
- $notpost = isset($notpost) && $notpost == 1 ? 1: 0;
- if(empty($litpic_b64)) $litpic_b64 = '';
-
- if(empty($typeid2)) $typeid2 = 0;
- if(!isset($autokey)) $autokey = 0;
- if(!isset($remote)) $remote = 0;
- if(!isset($dellink)) $dellink = 0;
- if(!isset($autolitpic)) $autolitpic = 0;
- if(!isset($writer)) $writer = '';
-
- if($typeid==0)
- {
- ShowMsg("请指定文档的栏目!","-1");
+-------------------------------*/ else if ($dopost == 'save') {
+ require_once(DEDEINC . '/image.func.php');
+ require_once(DEDEINC . '/oxwindow.class.php');
+ $flag = isset($flags) ? join(',', $flags) : '';
+ $notpost = isset($notpost) && $notpost == 1 ? 1 : 0;
+ if (empty($litpic_b64)) $litpic_b64 = '';
+
+ if (empty($typeid2)) $typeid2 = 0;
+ if (!isset($autokey)) $autokey = 0;
+ if (!isset($remote)) $remote = 0;
+ if (!isset($dellink)) $dellink = 0;
+ if (!isset($autolitpic)) $autolitpic = 0;
+ if (!isset($writer)) $writer = '';
+
+ if ($typeid == 0) {
+ ShowMsg("请指定文档的栏目!", "-1");
exit();
}
- if(empty($channelid))
- {
- ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!","-1");
+ if (empty($channelid)) {
+ ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!", "-1");
exit();
}
- if(!CheckChannel($typeid,$channelid))
- {
- ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!","-1");
+ if (!CheckChannel($typeid, $channelid)) {
+ ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!", "-1");
exit();
}
- if(!TestPurview('a_Edit'))
- {
- if(TestPurview('a_AccEdit'))
- {
- CheckCatalog($typeid,"对不起,你没有操作栏目 {$typeid} 的文档权限!");
- }
- else
- {
- CheckArcAdmin($id,$cuserLogin->getUserID());
+ if (!TestPurview('a_Edit')) {
+ if (TestPurview('a_AccEdit')) {
+ CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的文档权限!");
+ } else {
+ CheckArcAdmin($id, $cuserLogin->getUserID());
}
}
//对保存的内容进行处理
$pubdate = GetMkTime($pubdate);
$sortrank = AddDay($pubdate, $sortup);
- $ismake = $ishtml==0 ? -1 : 0;
+ $ismake = $ishtml == 0 ? -1 : 0;
$title = cn_substrR($title, $cfg_title_maxlen);
$shorttitle = cn_substrR($shorttitle, 36);
$color = cn_substrR($color, 7);
@@ -108,77 +97,69 @@ else if($dopost=='save')
$keywords = trim(cn_substrR($keywords, 60));
$filename = trim(cn_substrR($filename, 40));
$isremote = 0;
- $serviterm=empty($serviterm)? "" : $serviterm;
- if(!TestPurview('a_Check,a_AccCheck,a_MyCheck')) $arcrank = -1;
+ $serviterm = empty($serviterm) ? "" : $serviterm;
+ 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);
// 处理新的缩略图上传
if ($litpic_b64 != "") {
- $data = explode( ',', $litpic_b64 );
+ $data = explode(',', $litpic_b64);
$ntime = time();
- $savepath = $ddcfg_image_dir.'/'.MyDate($cfg_addon_savetype, $ntime);
+ $savepath = $ddcfg_image_dir . '/' . MyDate($cfg_addon_savetype, $ntime);
CreateDir($savepath);
- $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999));
- $fullUrl = $fullUrl.".png";
-
- file_put_contents($cfg_basedir.$fullUrl, base64_decode( $data[ 1 ] ));
+ $fullUrl = $savepath . '/' . dd2char(MyDate('mdHis', $ntime) . $cuserLogin->getUserID() . mt_rand(1000, 9999));
+ $fullUrl = $fullUrl . ".png";
+
+ file_put_contents($cfg_basedir . $fullUrl, base64_decode($data[1]));
// 加水印
- WaterImg($cfg_basedir.$fullUrl, 'up');
+ WaterImg($cfg_basedir . $fullUrl, 'up');
$litpic = $fullUrl;
}
//分析处理附加表数据
$inadd_f = '';
$inadd_v = '';
- if(!empty($dede_addonfields))
- {
- $addonfields = explode(';',$dede_addonfields);
+ if (!empty($dede_addonfields)) {
+ $addonfields = explode(';', $dede_addonfields);
$inadd_f = '';
$inadd_v = '';
- if(is_array($addonfields))
- {
- foreach($addonfields as $v)
- {
- if($v=='')
- {
+ if (is_array($addonfields)) {
+ foreach ($addonfields as $v) {
+ if ($v == '') {
continue;
}
- $vs = explode(',',$v);
- if($vs[1]=='htmltext'||$vs[1]=='textdata') //HTML文本特殊处理
- {
- ${$vs[0]} = AnalyseHtmlBody(${$vs[0]},$description,$litpic,$keywords,$vs[1]);
- }else
+ $vs = explode(',', $v);
+ if ($vs[1] == 'htmltext' || $vs[1] == 'textdata') //HTML文本特殊处理
{
- if(!isset(${$vs[0]}))
- {
+ ${$vs[0]} = AnalyseHtmlBody(${$vs[0]}, $description, $litpic, $keywords, $vs[1]);
+ } else {
+ if (!isset(${$vs[0]})) {
${$vs[0]} = '';
}
- ${$vs[0]} = GetFieldValueA(${$vs[0]},$vs[1],$id);
+ ${$vs[0]} = GetFieldValueA(${$vs[0]}, $vs[1], $id);
}
- $inadd_f .= ",`{$vs[0]}` = '".${$vs[0]}."'";
+ $inadd_f .= ",`{$vs[0]}` = '" . ${$vs[0]} . "'";
}
}
}
//处理图片文档的自定义属性
- if($litpic!='' && !preg_match("#p#", $flag))
- {
- $flag = ($flag=='' ? 'p' : $flag.',p');
+ if ($litpic != '' && !preg_match("#p#", $flag)) {
+ $flag = ($flag == '' ? 'p' : $flag . ',p');
}
- if($redirecturl!='' && !preg_match("#j#", $flag))
- {
- $flag = ($flag=='' ? 'j' : $flag.',j');
+ if ($redirecturl != '' && !preg_match("#j#", $flag)) {
+ $flag = ($flag == '' ? 'j' : $flag . ',j');
}
//跳转网址的文档强制为动态
- if(preg_match("#j#", $flag)) $ismake = -1;
+ if (preg_match("#j#", $flag)) $ismake = -1;
//更新数据库的SQL语句
$inQuery = "UPDATE `#@__archives` SET
typeid='$typeid',
@@ -203,52 +184,46 @@ else if($dopost=='save')
dutyadmin='$adminid',
weight='$weight'
WHERE id='$id'; ";
- if(!$dsql->ExecuteNoneQuery($inQuery))
- {
- ShowMsg("更新数据库archives表时出错,请检查!","-1");
+ if (!$dsql->ExecuteNoneQuery($inQuery)) {
+ ShowMsg("更新数据库archives表时出错,请检查!", "-1");
exit();
}
$cts = $dsql->GetOne("SELECT addtable From `#@__channeltype` WHERE id='$channelid' ");
$addtable = trim($cts['addtable']);
- if($addtable!='')
- {
+ if ($addtable != '') {
$useip = GetIP();
$iquery = "UPDATE `$addtable` SET typeid='$typeid'{$inadd_f},redirecturl='$redirecturl',userip='$useip' WHERE aid='$id' ";
- if(!$dsql->ExecuteNoneQuery($iquery))
- {
- ShowMsg("更新附加表 `$addtable` 时出错,请检查原因!","javascript:;");
+ if (!$dsql->ExecuteNoneQuery($iquery)) {
+ ShowMsg("更新附加表 `$addtable` 时出错,请检查原因!", "javascript:;");
exit();
}
}
//生成HTML
UpIndexKey($id, $arcrank, $typeid, $sortrank, $tags);
- if($cfg_remote_site=='Y' && $isremote=="1")
- {
- if($serviterm!="")
- {
+ if ($cfg_remote_site == 'Y' && $isremote == "1") {
+ if ($serviterm != "") {
list($servurl, $servuser, $servpwd) = explode(',', $serviterm);
- $config=array( 'hostname' => $servurl, 'username' => $servuser, 'password' => $servpwd,'debug' => 'TRUE');
+ $config = array('hostname' => $servurl, 'username' => $servuser, 'password' => $servpwd, 'debug' => 'TRUE');
} else {
- $config=array();
+ $config = array();
}
- if(!$ftp->connect($config)) exit('Error:None FTP Connection!');
+ if (!$ftp->connect($config)) exit('Error:None FTP Connection!');
}
$artUrl = MakeArt($id, TRUE, TRUE, $isremote);
- if($artUrl=='')
- {
- $artUrl = $cfg_phpurl."/view.php?aid=$id";
+ if ($artUrl == '') {
+ $artUrl = $cfg_phpurl . "/view.php?aid=$id";
}
ClearMyAddon($id, $title);
-
+
// 自动更新关联内容
if (is_array($automake)) {
foreach ($automake as $key => $value) {
if (isset(${$key}) && !empty(${$key})) {
$ids = explode(",", ${$key});
foreach ($ids as $id) {
- MakeArt($id,true,true,$isremote);
+ MakeArt($id, true, true, $isremote);
}
}
}
@@ -259,7 +234,7 @@ else if($dopost=='save')
请选择你的后续操作:
发布新文档
-
查看更改
+
查看更改
查看文档
@@ -273,6 +248,6 @@ else if($dopost=='save')
$win = new OxWindow();
$win->AddTitle("成功更改文档:");
$win->AddMsgItem($msg);
- $winform = $win->GetWindow("hand"," ",false);
+ $winform = $win->GetWindow("hand", " ", false);
$win->Display();
-}
\ No newline at end of file
+}
diff --git a/src/dede/archives_sg_add.php b/src/dede/archives_sg_add.php
index f33aabbf..dd55a811 100755
--- a/src/dede/archives_sg_add.php
+++ b/src/dede/archives_sg_add.php
@@ -1,39 +1,35 @@
0 && $channelid == 0)
- {
+ if ($cid > 0 && $channelid == 0) {
$row = $dsql->GetOne("SELECT channeltype FROM `#@__arctype` WHERE id='$cid'; ");
$channelid = $row['channeltype'];
- }
- else
- {
- if($channelid==0)
- {
- ShowMsg("无法识别模型信息,因此无法操作!","-1");
+ } else {
+ if ($channelid == 0) {
+ ShowMsg("无法识别模型信息,因此无法操作!", "-1");
exit();
}
}
@@ -46,146 +42,126 @@ if($dopost!='save')
}
/*--------------------------------
function __save(){ }
--------------------------------*/
-else if($dopost=='save')
-{
- require_once(DEDEINC.'/image.func.php');
- require_once(DEDEINC.'/oxwindow.class.php');
-
- if($typeid==0)
- {
- ShowMsg("请指定文档的栏目!","-1");
+-------------------------------*/ else if ($dopost == 'save') {
+ require_once(DEDEINC . '/image.func.php');
+ require_once(DEDEINC . '/oxwindow.class.php');
+
+ if ($typeid == 0) {
+ ShowMsg("请指定文档的栏目!", "-1");
exit();
}
- if(empty($channelid))
- {
- ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!","-1");
+ if (empty($channelid)) {
+ ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!", "-1");
exit();
}
- if(!CheckChannel($typeid,$channelid) )
- {
- ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!","-1");
+ if (!CheckChannel($typeid, $channelid)) {
+ ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!", "-1");
exit();
}
- if(!TestPurview('a_New'))
- {
- CheckCatalog($typeid,"对不起,你没有操作栏目 {$typeid} 的权限!");
+ if (!TestPurview('a_New')) {
+ CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的权限!");
}
//对保存的内容进行处理
- if(empty($writer))$writer=$cuserLogin->getUserName();
- if(empty($source))$source='未知';
- if(empty($flags)) $flag = '';
+ if (empty($writer)) $writer = $cuserLogin->getUserName();
+ if (empty($source)) $source = '未知';
+ if (empty($flags)) $flag = '';
else $flag = join(',', $flags);
$senddate = time();
- if(empty($litpic_b64)) $litpic_b64 = '';
- $title = cn_substrR($title,$cfg_title_maxlen);
+ if (empty($litpic_b64)) $litpic_b64 = '';
+ $title = cn_substrR($title, $cfg_title_maxlen);
$isremote = 0;
- $serviterm=empty($serviterm)? "" : $serviterm;
- if(!TestPurview('a_Check,a_AccCheck,a_MyCheck')) $arcrank = -1;
+ $serviterm = empty($serviterm) ? "" : $serviterm;
+ if (!TestPurview('a_Check,a_AccCheck,a_MyCheck')) $arcrank = -1;
$adminid = $cuserLogin->getUserID();
$userip = GetIP();
- if(empty($ddisremote)) $ddisremote = 0;
+ if (empty($ddisremote)) $ddisremote = 0;
$litpic = GetDDImage('none', $picname, $ddisremote);
// 处理新的缩略图上传
if ($litpic_b64 != "") {
- $data = explode( ',', $litpic_b64 );
+ $data = explode(',', $litpic_b64);
$ntime = time();
- $savepath = $ddcfg_image_dir.'/'.MyDate($cfg_addon_savetype, $ntime);
+ $savepath = $ddcfg_image_dir . '/' . MyDate($cfg_addon_savetype, $ntime);
CreateDir($savepath);
- $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999));
- $fullUrl = $fullUrl.".png";
-
- file_put_contents($cfg_basedir.$fullUrl, base64_decode( $data[ 1 ] ));
+ $fullUrl = $savepath . '/' . dd2char(MyDate('mdHis', $ntime) . $cuserLogin->getUserID() . mt_rand(1000, 9999));
+ $fullUrl = $fullUrl . ".png";
+
+ file_put_contents($cfg_basedir . $fullUrl, base64_decode($data[1]));
// 加水印
- WaterImg($cfg_basedir.$fullUrl, 'up');
+ WaterImg($cfg_basedir . $fullUrl, 'up');
$litpic = $fullUrl;
}
//生成文档ID
$arcID = GetIndexKey($arcrank, $typeid, $senddate, $channelid, $senddate, $adminid);
- if(empty($arcID))
- {
- ShowMsg("无法获得主键,因此无法进行后续操作!","-1");
+ if (empty($arcID)) {
+ ShowMsg("无法获得主键,因此无法进行后续操作!", "-1");
exit();
}
//分析处理附加表数据
$inadd_f = '';
$inadd_v = '';
- if(!empty($dede_addonfields))
- {
- $addonfields = explode(';',$dede_addonfields);
+ if (!empty($dede_addonfields)) {
+ $addonfields = explode(';', $dede_addonfields);
$inadd_f = '';
$inadd_v = '';
- if(is_array($addonfields))
- {
- foreach($addonfields as $v)
- {
- if($v=='')
- {
+ if (is_array($addonfields)) {
+ foreach ($addonfields as $v) {
+ if ($v == '') {
continue;
}
- $vs = explode(',',$v);
- if($vs[1]=='htmltext'||$vs[1]=='textdata') //HTML文本特殊处理
- {
- ${$vs[0]} = AnalyseHtmlBody(${$vs[0]},$description,$litpic,$keywords,$vs[1]);
- }
- else
+ $vs = explode(',', $v);
+ if ($vs[1] == 'htmltext' || $vs[1] == 'textdata') //HTML文本特殊处理
{
- if(!isset(${$vs[0]}))
- {
+ ${$vs[0]} = AnalyseHtmlBody(${$vs[0]}, $description, $litpic, $keywords, $vs[1]);
+ } else {
+ if (!isset(${$vs[0]})) {
${$vs[0]} = '';
}
- ${$vs[0]} = GetFieldValueA(${$vs[0]},$vs[1],$arcID);
+ ${$vs[0]} = GetFieldValueA(${$vs[0]}, $vs[1], $arcID);
}
- $inadd_f .= ','.$vs[0];
- $inadd_v .= " ,'".${$vs[0]}."' ";
+ $inadd_f .= ',' . $vs[0];
+ $inadd_v .= " ,'" . ${$vs[0]} . "' ";
}
}
}
//处理图片文档的自定义属性
- if($litpic!='' && !preg_match("#p#", $flag))
- {
- $flag = ($flag=='' ? 'p' : $flag.',p');
+ if ($litpic != '' && !preg_match("#p#", $flag)) {
+ $flag = ($flag == '' ? 'p' : $flag . ',p');
}
//保存到附加表
$cts = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid' ");
$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})";
- if(!$dsql->ExecuteNoneQuery($query))
- {
+ if (!$dsql->ExecuteNoneQuery($query)) {
$gerr = $dsql->GetError();
$dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'");
- ShowMsg("把数据保存到数据库附加表 `{$addtable}` 时出错,请把相关信息提交给DedeCMS官方。".str_replace('"','',$gerr),"javascript:;");
+ ShowMsg("把数据保存到数据库附加表 `{$addtable}` 时出错,请把相关信息提交给DedeCMS官方。" . str_replace('"', '', $gerr), "javascript:;");
exit();
}
}
//生成HTML
- if($cfg_remote_site=='Y' && $isremote=="1")
- {
- if($serviterm!="")
- {
+ if ($cfg_remote_site == 'Y' && $isremote == "1") {
+ if ($serviterm != "") {
list($servurl, $servuser, $servpwd) = explode(',', $serviterm);
- $config=array( 'hostname' => $servurl, 'username' => $servuser, 'password' => $servpwd,'debug' => 'TRUE');
+ $config = array('hostname' => $servurl, 'username' => $servuser, 'password' => $servpwd, 'debug' => 'TRUE');
} else {
- $config=array();
+ $config = array();
}
- if(!$ftp->connect($config)) exit('Error:None FTP Connection!');
+ if (!$ftp->connect($config)) exit('Error:None FTP Connection!');
}
$artUrl = MakeArt($arcID, TRUE, TRUE, $isremote);
- if($artUrl=='')
- {
- $artUrl = $cfg_phpurl."/view.php?aid=$arcID";
+ if ($artUrl == '') {
+ $artUrl = $cfg_phpurl . "/view.php?aid=$arcID";
}
ClearMyAddon($arcID, $title);
//返回成功信息
@@ -195,7 +171,7 @@ else if($dopost=='save')
查看文档
-
更改文档
+
更改文档
已发布文档管理
@@ -207,6 +183,6 @@ else if($dopost=='save')
$win = new OxWindow();
$win->AddTitle("成功发布文档:");
$win->AddMsgItem($msg);
- $winform = $win->GetWindow("hand"," ",false);
+ $winform = $win->GetWindow("hand", " ", false);
$win->Display();
-}
\ No newline at end of file
+}
diff --git a/src/dede/archives_sg_edit.php b/src/dede/archives_sg_edit.php
index ef6b1078..9788c3b3 100755
--- a/src/dede/archives_sg_edit.php
+++ b/src/dede/archives_sg_edit.php
@@ -1,24 +1,24 @@
GetOne($arcQuery);
- if(!is_array($cInfos))
- {
- ShowMsg("读频道模型信息出错!","-1");
+ if (!is_array($cInfos)) {
+ ShowMsg("读频道模型信息出错!", "-1");
exit();
}
@@ -42,134 +41,116 @@ if($dopost!='save')
}
/*--------------------------------
function __save(){ }
--------------------------------*/
-else if($dopost=='save')
-{
- require_once(DEDEINC.'/image.func.php');
- require_once(DEDEINC.'/oxwindow.class.php');
- if($typeid==0)
- {
- ShowMsg("请指定文档的栏目!","-1");
+-------------------------------*/ else if ($dopost == 'save') {
+ require_once(DEDEINC . '/image.func.php');
+ require_once(DEDEINC . '/oxwindow.class.php');
+ if ($typeid == 0) {
+ ShowMsg("请指定文档的栏目!", "-1");
exit();
}
- if(empty($channelid))
- {
- ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!","-1");
+ if (empty($channelid)) {
+ ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!", "-1");
exit();
}
- if(!CheckChannel($typeid,$channelid))
- {
- ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!","-1");
+ if (!CheckChannel($typeid, $channelid)) {
+ ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!", "-1");
exit();
}
- if(!TestPurview('a_Edit'))
- {
- if(TestPurview('a_AccEdit'))
- {
+ if (!TestPurview('a_Edit')) {
+ if (TestPurview('a_AccEdit')) {
CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的文档权限!");
- }
- else
- {
- CheckArcAdmin($id,$cuserLogin->getUserID());
+ } else {
+ CheckArcAdmin($id, $cuserLogin->getUserID());
}
}
//对保存的内容进行处理
- if(empty($flags)) $flag = '';
+ if (empty($flags)) $flag = '';
else $flag = join(',', $flags);
$title = cn_substrR($title, $cfg_title_maxlen);
$isremote = 0;
- $serviterm=empty($serviterm)? "" : $serviterm;
- if(empty($litpic_b64)) $litpic_b64 = '';
- if(!TestPurview('a_Check,a_AccCheck,a_MyCheck')) $arcrank = -1;
+ $serviterm = empty($serviterm) ? "" : $serviterm;
+ if (empty($litpic_b64)) $litpic_b64 = '';
+ 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);
// 处理新的缩略图上传
if ($litpic_b64 != "") {
- $data = explode( ',', $litpic_b64 );
+ $data = explode(',', $litpic_b64);
$ntime = time();
- $savepath = $ddcfg_image_dir.'/'.MyDate($cfg_addon_savetype, $ntime);
+ $savepath = $ddcfg_image_dir . '/' . MyDate($cfg_addon_savetype, $ntime);
CreateDir($savepath);
- $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999));
- $fullUrl = $fullUrl.".png";
-
- file_put_contents($cfg_basedir.$fullUrl, base64_decode( $data[ 1 ] ));
+ $fullUrl = $savepath . '/' . dd2char(MyDate('mdHis', $ntime) . $cuserLogin->getUserID() . mt_rand(1000, 9999));
+ $fullUrl = $fullUrl . ".png";
+
+ file_put_contents($cfg_basedir . $fullUrl, base64_decode($data[1]));
// 加水印
- WaterImg($cfg_basedir.$fullUrl, 'up');
+ WaterImg($cfg_basedir . $fullUrl, 'up');
$litpic = $fullUrl;
}
//分析处理附加表数据
$inadd_f = '';
$inadd_v = '';
- if(!empty($dede_addonfields))
- {
+ if (!empty($dede_addonfields)) {
$addonfields = explode(';', $dede_addonfields);
$inadd_f = '';
$inadd_v = '';
- if(is_array($addonfields))
- {
- foreach($addonfields as $v)
- {
- if($v=='')
- {
+ if (is_array($addonfields)) {
+ foreach ($addonfields as $v) {
+ if ($v == '') {
continue;
}
- $vs = explode(',',$v);
- if($vs[1]=='htmltext'||$vs[1]=='textdata') //HTML文本特殊处理
- {
- ${$vs[0]} = AnalyseHtmlBody(${$vs[0]},$description,$litpic,$keywords,$vs[1]);
- }else
+ $vs = explode(',', $v);
+ if ($vs[1] == 'htmltext' || $vs[1] == 'textdata') //HTML文本特殊处理
{
- if(!isset(${$vs[0]}))
- {
+ ${$vs[0]} = AnalyseHtmlBody(${$vs[0]}, $description, $litpic, $keywords, $vs[1]);
+ } else {
+ if (!isset(${$vs[0]})) {
${$vs[0]} = '';
}
- ${$vs[0]} = GetFieldValueA(${$vs[0]},$vs[1],$id);
+ ${$vs[0]} = GetFieldValueA(${$vs[0]}, $vs[1], $id);
}
- $inadd_f .= ",`{$vs[0]}` = '".${$vs[0]}."'";
+ $inadd_f .= ",`{$vs[0]}` = '" . ${$vs[0]} . "'";
}
}
}
-
+
//处理图片文档的自定义属性
- if($litpic!='' && !preg_match("#p#", $flag))
- {
- $flag = ($flag=='' ? 'p' : $flag.',p');
+ if ($litpic != '' && !preg_match("#p#", $flag)) {
+ $flag = ($flag == '' ? 'p' : $flag . ',p');
}
$cts = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid' ");
$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' ";
- if(!$dsql->ExecuteNoneQuery($iquery))
- {
- ShowMsg("更新附加表 `$addtable` 时出错,请检查原因!","javascript:;");
+ if (!$dsql->ExecuteNoneQuery($iquery)) {
+ ShowMsg("更新附加表 `$addtable` 时出错,请检查原因!", "javascript:;");
exit();
}
}
//生成HTML
UpIndexKey($id, $arcrank, $typeid, $sortrank, '');
- if($cfg_remote_site=='Y' && $isremote=="1")
- {
- if($serviterm!="")
- {
+ if ($cfg_remote_site == 'Y' && $isremote == "1") {
+ if ($serviterm != "") {
list($servurl, $servuser, $servpwd) = explode(',', $serviterm);
- $config = array( 'hostname' => $servurl, 'username' => $servuser,
- 'password' => $servpwd,'debug' => 'TRUE');
+ $config = array(
+ 'hostname' => $servurl, 'username' => $servuser,
+ 'password' => $servpwd, 'debug' => 'TRUE'
+ );
} else {
$config = array();
}
- if(!$ftp->connect($config)) exit('Error:None FTP Connection!');
+ if (!$ftp->connect($config)) exit('Error:None FTP Connection!');
}
$artUrl = MakeArt($id, TRUE, TRUE, $isremote);
- if($artUrl=='') $artUrl = $cfg_phpurl."/view.php?aid=$id";
+ if ($artUrl == '') $artUrl = $cfg_phpurl . "/view.php?aid=$id";
ClearMyAddon($id, $title);
//返回成功信息
@@ -177,7 +158,7 @@ else if($dopost=='save')
请选择你的后续操作:
发布新文档
-
查看更改
+
查看更改
查看文档
@@ -191,6 +172,6 @@ else if($dopost=='save')
$win = new OxWindow();
$win->AddTitle("成功更改文档:");
$win->AddMsgItem($msg);
- $winform = $win->GetWindow("hand"," ",false);
+ $winform = $win->GetWindow("hand", " ", false);
$win->Display();
-}
\ No newline at end of file
+}
diff --git a/src/dede/article_add.php b/src/dede/article_add.php
index 38faf927..2e906985 100755
--- a/src/dede/article_add.php
+++ b/src/dede/article_add.php
@@ -3,7 +3,7 @@
* 文档发布
*
* @version $Id: article_add.php 2020年9月14日 tianya $
- * @package DedeCMS.Administrator
+ * @package DedeBIZ.Administrator
* @copyright Copyright (c) 2020, DedeBIZ.COM
* @license https://www.dedebiz.com/license
* @link https://www.dedebiz.com
@@ -317,5 +317,3 @@ else if($dopost=='save')
$winform = $win->GetWindow("hand"," ",false);
$win->Display();
}
-
-?>
\ No newline at end of file
diff --git a/src/dede/article_allowurl_edit.php b/src/dede/article_allowurl_edit.php
index 85d8fec8..f06335bd 100755
--- a/src/dede/article_allowurl_edit.php
+++ b/src/dede/article_allowurl_edit.php
@@ -1,44 +1,43 @@
alert('Save OK!');";
}
//读出
-if(empty($allurls) && filesize($m_file)>0)
-{
- $fp = fopen($m_file,'r');
- $allurls = fread($fp,filesize($m_file));
+if (empty($allurls) && filesize($m_file) > 0) {
+ $fp = fopen($m_file, 'r');
+ $allurls = fread($fp, filesize($m_file));
fclose($fp);
}
$wintitle = "";
$wecome_info = "允许的超链接";
$win = new OxWindow();
-$win->Init('article_allowurl_edit.php','js/blank.js','POST');
-$win->AddHidden('dopost','save');
+$win->Init('article_allowurl_edit.php', 'js/blank.js', 'POST');
+$win->AddHidden('dopost', 'save');
$win->AddTitle("每行保存一个超链接:");
$win->AddMsgItem("
");
$winform = $win->GetWindow('ok');
-$win->Display();
\ No newline at end of file
+$win->Display();
diff --git a/src/dede/article_coonepage_rule.php b/src/dede/article_coonepage_rule.php
index e6e30a9e..0b3143dc 100755
--- a/src/dede/article_coonepage_rule.php
+++ b/src/dede/article_coonepage_rule.php
@@ -1,123 +1,113 @@
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();
- }
+if ($action == 'add') {
+ $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')
-{
- 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);
+-------*/ 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);
}
/*------
function _EditNote(){ }
--------*/
-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();
+-------*/ 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();
}
/*------
function _EditNoteLoad(){ }
--------*/
-else if($action == 'editload')
-{
- $row = $dsql->GetOne("SELECT * FROM `#@__co_onepage` WHERE id='$id' ");
- AjaxHead();
+-------*/ else if ($action == 'editload') {
+ $row = $dsql->GetOne("SELECT * FROM `#@__co_onepage` WHERE id='$id' ");
+ AjaxHead();
?>
-
+
SetTemplate(DEDEADMIN."/templets/article_coonepage_rule.htm");
+$dlist->SetTemplate(DEDEADMIN . "/templets/article_coonepage_rule.htm");
$dlist->SetSource($sql);
$dlist->Display();
diff --git a/src/dede/article_description_main.php b/src/dede/article_description_main.php
index e3629153..7a7542cb 100755
--- a/src/dede/article_description_main.php
+++ b/src/dede/article_description_main.php
@@ -1,65 +1,56 @@
250) $dsize = 250;
+ if ($dsize > 250) $dsize = 250;
$tjnum = 0;
//获取自动摘要
- if($dojob=='des')
- {
- if(empty($totalnum))
- {
+ if ($dojob == 'des') {
+ if (empty($totalnum)) {
$addquery = "";
- if($sid!=0)
- {
+ if ($sid != 0) {
$addquery .= " AND id>='$sid' ";
}
- if($eid!=0)
- {
+ if ($eid != 0) {
$addquery .= " AND id<='$eid' ";
}
$tjQuery = "SELECT COUNT(*) AS dd FROM #@__archives WHERE channel='{$channel}' $addquery";
$row = $dsql->GetOne($tjQuery);
$totalnum = $row['dd'];
}
- if($totalnum > 0)
- {
+ if ($totalnum > 0) {
$addquery = "";
- if($sid!=0)
- {
+ if ($sid != 0) {
$addquery .= " AND #@__archives.id>='$sid' ";
}
- if($eid!=0)
- {
+ if ($eid != 0) {
$addquery .= " AND #@__archives.id<='$eid' ";
}
$fquery = "SELECT #@__archives.id,#@__archives.title,#@__archives.description,{$table}.{$field}
@@ -67,22 +58,18 @@ else
WHERE #@__archives.channel='{$channel}' $addquery LIMIT $startdd,$pagesize ; ";
$dsql->SetQuery($fquery);
$dsql->Execute();
- while($row=$dsql->GetArray())
- {
+ while ($row = $dsql->GetArray()) {
$body = $row[$field];
$description = $row['description'];
- if(strlen($description)>10 || $description=='-')
- {
+ if (strlen($description) > 10 || $description == '-') {
continue;
}
- $bodytext = preg_replace("/#p#|#e#|副标题|分页标题/isU","",Html2Text($body));
- if(strlen($bodytext) < $msize)
- {
+ $bodytext = preg_replace("/#p#|#e#|副标题|分页标题/isU", "", Html2Text($body));
+ if (strlen($bodytext) < $msize) {
continue;
}
- $des = trim(addslashes(cn_substr($bodytext,$dsize)));
- if(strlen($des)<3)
- {
+ $des = trim(addslashes(cn_substr($bodytext, $dsize)));
+ if (strlen($des) < 3) {
$des = "-";
}
$dsql->ExecuteNoneQuery("UPDATE #@__archives SET description='{$des}' WHERE id='{$row['id']}';");
@@ -90,11 +77,10 @@ else
//返回进度信息
$startdd = $startdd + $pagesize;
- if($totalnum > $startdd)
- {
- $tjlen = ceil( ($startdd/$totalnum) * 100 );
+ if ($totalnum > $startdd) {
+ $tjlen = ceil(($startdd / $totalnum) * 100);
} else {
- $tjlen=100;
+ $tjlen = 100;
ShowMsg('完成所有任务', 'javascript:;');
exit();
}
@@ -102,84 +88,66 @@ else
$tjsta = "
";
$tjsta .= "
完成处理文档总数的:$tjlen %,继续执行任务...";
$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();
- }
- else
- {
+ } else {
ShowMsg('完成所有任务', 'javascript:;');
exit();
}
- }//获取自动摘要代码结束
+ } //获取自动摘要代码结束
//更新自动分页
- if($dojob=='page')
- {
- require_once(DEDEADMIN."/inc/inc_archives_functions.php");
+ if ($dojob == 'page') {
+ require_once(DEDEADMIN . "/inc/inc_archives_functions.php");
$addquery = "";
- if($sid!=0)
- {
+ if ($sid != 0) {
$addquery .= " and aid>='$sid' ";
}
- if($eid!=0)
- {
+ if ($eid != 0) {
$addquery .= " and aid<='$eid' ";
}
//统计记录总数
- if($totalnum==0)
- {
+ if ($totalnum == 0) {
$sql = "SELECT COUNT(*) AS dd FROM $table WHERE 1 $addquery";
$row = $dsql->GetOne($sql);
$totalnum = $row['dd'];
}
//获取记录,并分析
- if($totalnum > $startdd+$pagesize)
- {
+ if ($totalnum > $startdd + $pagesize) {
$limitSql = " LIMIT $startdd,$pagesize";
- }
- else if(($totalnum-$startdd)>0)
- {
- $limitSql = " LIMIT $startdd,".($totalnum - $startdd);
- }
- else
- {
+ } else if (($totalnum - $startdd) > 0) {
+ $limitSql = " LIMIT $startdd," . ($totalnum - $startdd);
+ } else {
$limitSql = "";
}
$tjnum = $startdd;
- if($limitSql!="")
- {
+ if ($limitSql != "") {
$fquery = "SELECT aid,$field FROM $table WHERE 1 $addquery $limitSql ;";
$dsql->SetQuery($fquery);
$dsql->Execute();
- while($row=$dsql->GetArray())
- {
+ while ($row = $dsql->GetArray()) {
$tjnum++;
$body = $row[$field];
$aid = $row['aid'];
- if(strlen($body) < $msize)
- {
+ if (strlen($body) < $msize) {
continue;
}
- if(!preg_match("/#p#/iU",$body))
- {
- $body = SpLongBody($body,$cfg_arcautosp_size*1024,"#p#分页标题#e#");
+ if (!preg_match("/#p#/iU", $body)) {
+ $body = SpLongBody($body, $cfg_arcautosp_size * 1024, "#p#分页标题#e#");
$body = addslashes($body);
$dsql->ExecuteNoneQuery("UPDATE $table SET $field='$body' WHERE aid='$aid' ; ");
}
}
- }//end if limit
+ } //end if limit
//返回进度提示
- if($totalnum>0)
- {
- $tjlen = ceil( ($tjnum/$totalnum) * 100 );
- }
- else
- {
- $tjlen=100;
+ if ($totalnum > 0) {
+ $tjlen = ceil(($tjnum / $totalnum) * 100);
+ } else {
+ $tjlen = 100;
}
$dvlen = $tjlen * 2;
@@ -187,16 +155,13 @@ else
$tjsta = "
";
$tjsta .= "
完成处理文档总数的:$tjlen %,继续执行任务...";
- 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}";
- ShowMsg($tjsta,$nurl,0,500);
+ 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}";
+ ShowMsg($tjsta, $nurl, 0, 500);
exit();
- }
- else
- {
+ } else {
ShowMsg('完成所有任务', 'javascript:;');
exit();
}
- }//更新自动分页处理代码结束
-}
\ No newline at end of file
+ } //更新自动分页处理代码结束
+}
diff --git a/src/dede/article_edit.php b/src/dede/article_edit.php
index b87c6b36..c66d8b3d 100755
--- a/src/dede/article_edit.php
+++ b/src/dede/article_edit.php
@@ -1,29 +1,28 @@
GetOne($query);
- if(!is_array($arcRow))
- {
- ShowMsg("读取档案基本信息出错!","-1");
+ if (!is_array($arcRow)) {
+ ShowMsg("读取档案基本信息出错!", "-1");
exit();
}
- $query = "SELECT * FROM `#@__channeltype` WHERE id='".$arcRow['channel']."'";
+ $query = "SELECT * FROM `#@__channeltype` WHERE id='" . $arcRow['channel'] . "'";
$cInfos = $dsql->GetOne($query);
- if(!is_array($cInfos))
- {
- ShowMsg("读取频道配置信息出错!","javascript:;");
+ if (!is_array($cInfos)) {
+ ShowMsg("读取频道配置信息出错!", "javascript:;");
exit();
}
$addtable = $cInfos['addtable'];
$addRow = $dsql->GetOne("SELECT * FROM `$addtable` WHERE aid='$aid'");
- if(!is_array($addRow))
- {
- ShowMsg("读取附加信息出错!","javascript:;");
+ if (!is_array($addRow)) {
+ ShowMsg("读取附加信息出错!", "javascript:;");
exit();
}
$channelid = $arcRow['channel'];
@@ -58,44 +54,35 @@ if($dopost!='save')
}
/*--------------------------------
function __save(){ }
--------------------------------*/
-else if($dopost=='save')
-{
- require_once(DEDEINC.'/image.func.php');
- require_once(DEDEINC.'/oxwindow.class.php');
- $flag = isset($flags) ? join(',',$flags) : '';
- $notpost = isset($notpost) && $notpost == 1 ? 1: 0;
-
- if(empty($typeid2)) $typeid2 = 0;
- if(!isset($autokey)) $autokey = 0;
- if(!isset($remote)) $remote = 0;
- if(!isset($dellink)) $dellink = 0;
- if(!isset($autolitpic)) $autolitpic = 0;
- if(empty($litpic_b64)) $litpic_b64 = '';
-
- if(empty($typeid))
- {
+-------------------------------*/ else if ($dopost == 'save') {
+ require_once(DEDEINC . '/image.func.php');
+ require_once(DEDEINC . '/oxwindow.class.php');
+ $flag = isset($flags) ? join(',', $flags) : '';
+ $notpost = isset($notpost) && $notpost == 1 ? 1 : 0;
+
+ if (empty($typeid2)) $typeid2 = 0;
+ if (!isset($autokey)) $autokey = 0;
+ if (!isset($remote)) $remote = 0;
+ if (!isset($dellink)) $dellink = 0;
+ if (!isset($autolitpic)) $autolitpic = 0;
+ if (empty($litpic_b64)) $litpic_b64 = '';
+
+ if (empty($typeid)) {
ShowMsg("请指定文档的栏目!", "-1");
exit();
}
- if(empty($channelid))
- {
+ if (empty($channelid)) {
ShowMsg("文档为非指定的类型,请检查你发布内容的表单是否合法!", "-1");
exit();
}
- if(!CheckChannel($typeid, $channelid))
- {
+ if (!CheckChannel($typeid, $channelid)) {
ShowMsg("你所选择的栏目与当前模型不相符,请选择白色的选项!", "-1");
exit();
}
- if(!TestPurview('a_Edit'))
- {
- if(TestPurview('a_AccEdit'))
- {
+ if (!TestPurview('a_Edit')) {
+ if (TestPurview('a_AccEdit')) {
CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的文档权限!");
- }
- else
- {
+ } else {
CheckArcAdmin($id, $cuserLogin->getUserID());
}
}
@@ -103,96 +90,86 @@ else if($dopost=='save')
//对保存的内容进行处理
$pubdate = GetMkTime($pubdate);
- $sortrank = AddDay($pubdate,$sortup);
- $ismake = $ishtml==0 ? -1 : 0;
+ $sortrank = AddDay($pubdate, $sortup);
+ $ismake = $ishtml == 0 ? -1 : 0;
$autokey = 1;
- $title = dede_htmlspecialchars(cn_substrR($title,$cfg_title_maxlen));
- $shorttitle = cn_substrR($shorttitle,36);
- $color = cn_substrR($color,7);
- $writer = cn_substrR($writer,20);
- $source = cn_substrR($source,30);
- $description = cn_substrR($description,250);
- $keywords = trim(cn_substrR($keywords,60));
- $filename = trim(cn_substrR($filename,40));
+ $title = dede_htmlspecialchars(cn_substrR($title, $cfg_title_maxlen));
+ $shorttitle = cn_substrR($shorttitle, 36);
+ $color = cn_substrR($color, 7);
+ $writer = cn_substrR($writer, 20);
+ $source = cn_substrR($source, 30);
+ $description = cn_substrR($description, 250);
+ $keywords = trim(cn_substrR($keywords, 60));
+ $filename = trim(cn_substrR($filename, 40));
$isremote = 0;
- $serviterm=empty($serviterm)? "" : $serviterm;
- if(!TestPurview('a_Check,a_AccCheck,a_MyCheck'))
- {
+ $serviterm = empty($serviterm) ? "" : $serviterm;
+ if (!TestPurview('a_Check,a_AccCheck,a_MyCheck')) {
$arcrank = -1;
}
$adminid = $cuserLogin->getUserID();
//处理上传的缩略图
- if(empty($ddisremote))
- {
+ if (empty($ddisremote)) {
$ddisremote = 0;
}
- $litpic = GetDDImage('none',$picname,$ddisremote);
+ $litpic = GetDDImage('none', $picname, $ddisremote);
//分析body里的内容
- $body = AnalyseHtmlBody($body,$description,$litpic,$keywords,'htmltext');
+ $body = AnalyseHtmlBody($body, $description, $litpic, $keywords, 'htmltext');
//分析处理附加表数据
$inadd_f = '';
$inadd_v = '';
- if(!empty($dede_addonfields))
- {
- $addonfields = explode(';',$dede_addonfields);
+ if (!empty($dede_addonfields)) {
+ $addonfields = explode(';', $dede_addonfields);
$inadd_f = '';
$inadd_v = '';
- if(is_array($addonfields))
- {
- foreach($addonfields as $v)
- {
- if($v=='')
- {
+ if (is_array($addonfields)) {
+ foreach ($addonfields as $v) {
+ if ($v == '') {
continue;
}
- $vs = explode(',',$v);
- if($vs[1]=='htmltext'||$vs[1]=='textdata') //HTML文本特殊处理
+ $vs = explode(',', $v);
+ if ($vs[1] == 'htmltext' || $vs[1] == 'textdata') //HTML文本特殊处理
{
- ${$vs[0]} = AnalyseHtmlBody(${$vs[0]},$description,$litpic,$keywords,$vs[1]);
- }else
- {
- if(!isset(${$vs[0]}))
- {
+ ${$vs[0]} = AnalyseHtmlBody(${$vs[0]}, $description, $litpic, $keywords, $vs[1]);
+ } else {
+ if (!isset(${$vs[0]})) {
${$vs[0]} = '';
}
- ${$vs[0]} = GetFieldValueA(${$vs[0]},$vs[1],$id);
+ ${$vs[0]} = GetFieldValueA(${$vs[0]}, $vs[1], $id);
}
- $inadd_f .= ",`{$vs[0]}` = '".${$vs[0]}."'";
+ $inadd_f .= ",`{$vs[0]}` = '" . ${$vs[0]} . "'";
}
}
}
// 处理新的缩略图上传
if ($litpic_b64 != "") {
- $data = explode( ',', $litpic_b64 );
+ $data = explode(',', $litpic_b64);
$ntime = time();
- $savepath = $ddcfg_image_dir.'/'.MyDate($cfg_addon_savetype, $ntime);
+ $savepath = $ddcfg_image_dir . '/' . MyDate($cfg_addon_savetype, $ntime);
CreateDir($savepath);
- $fullUrl = $savepath.'/'.dd2char(MyDate('mdHis', $ntime).$cuserLogin->getUserID().mt_rand(1000, 9999));
- $fullUrl = $fullUrl.".png";
-
- file_put_contents($cfg_basedir.$fullUrl, base64_decode( $data[ 1 ] ));
+ $fullUrl = $savepath . '/' . dd2char(MyDate('mdHis', $ntime) . $cuserLogin->getUserID() . mt_rand(1000, 9999));
+ $fullUrl = $fullUrl . ".png";
+
+ file_put_contents($cfg_basedir . $fullUrl, base64_decode($data[1]));
// 加水印
- WaterImg($cfg_basedir.$fullUrl, 'up');
+ WaterImg($cfg_basedir . $fullUrl, 'up');
$litpic = $fullUrl;
}
//处理图片文档的自定义属性
- if($litpic!='' && !preg_match("#p#", $flag))
- {
- $flag = ($flag=='' ? 'p' : $flag.',p');
+ if ($litpic != '' && !preg_match("#p#", $flag)) {
+ $flag = ($flag == '' ? 'p' : $flag . ',p');
}
- if($redirecturl!='' && !preg_match("#j#", $flag))
- {
- $flag = ($flag=='' ? 'j' : $flag.',j');
+ if ($redirecturl != '' && !preg_match("#j#", $flag)) {
+ $flag = ($flag == '' ? 'j' : $flag . ',j');
}
//跳转网址的文档强制为动态
- if(preg_match("#j#", $flag)) $ismake = -1;
+ if (preg_match("#j#", $flag)) $ismake = -1;
//更新数据库的SQL语句
$query = "UPDATE #@__archives SET
typeid='$typeid',
@@ -218,43 +195,40 @@ else if($dopost=='save')
weight='$weight'
WHERE id='$id'; ";
- if(!$dsql->ExecuteNoneQuery($query))
- {
- ShowMsg('更新数据库archives表时出错,请检查',-1);
+ if (!$dsql->ExecuteNoneQuery($query)) {
+ ShowMsg('更新数据库archives表时出错,请检查', -1);
exit();
}
-
+
$cts = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid' ");
$addtable = trim($cts['addtable']);
- if($addtable!='')
- {
+ if ($addtable != '') {
$useip = GetIP();
$templet = empty($templet) ? '' : $templet;
$iquery = "UPDATE `$addtable` SET typeid='$typeid',body='$body'{$inadd_f},redirecturl='$redirecturl',templet='$templet',userip='$useip' WHERE aid='$id'";
- if(!$dsql->ExecuteNoneQuery($iquery))
- {
- ShowMsg("更新附加表 `$addtable` 时出错,请检查原因!","javascript:;");
+ if (!$dsql->ExecuteNoneQuery($iquery)) {
+ ShowMsg("更新附加表 `$addtable` 时出错,请检查原因!", "javascript:;");
exit();
}
}
//生成HTML
UpIndexKey($id, $arcrank, $typeid, $sortrank, $tags);
- if($cfg_remote_site=='Y' && $isremote=="1")
- {
- if($serviterm!=""){
+ if ($cfg_remote_site == 'Y' && $isremote == "1") {
+ if ($serviterm != "") {
list($servurl, $servuser, $servpwd) = explode(',', $serviterm);
- $config=array( 'hostname' => $servurl, 'username' => $servuser,
- 'password' => $servpwd,'debug' => 'TRUE');
+ $config = array(
+ 'hostname' => $servurl, 'username' => $servuser,
+ 'password' => $servpwd, 'debug' => 'TRUE'
+ );
} else {
- $config=array();
+ $config = array();
}
- if(!$ftp->connect($config)) exit('Error:None FTP Connection!');
+ if (!$ftp->connect($config)) exit('Error:None FTP Connection!');
}
- $artUrl = MakeArt($id,true,true,$isremote);
- if($artUrl=='')
- {
- $artUrl = $cfg_phpurl."/view.php?aid=$id";
+ $artUrl = MakeArt($id, true, true, $isremote);
+ if ($artUrl == '') {
+ $artUrl = $cfg_phpurl . "/view.php?aid=$id";
}
ClearMyAddon($id, $title);
@@ -264,18 +238,18 @@ else if($dopost=='save')
if (isset(${$key}) && !empty(${$key})) {
$ids = explode(",", ${$key});
foreach ($ids as $id) {
- MakeArt($id,true,true,$isremote);
+ MakeArt($id, true, true, $isremote);
}
}
}
}
-
+
//返回成功信息
$msg = "
请选择你的后续操作:
发布新文章
-
查看更改
+
查看更改
查看文章
@@ -289,6 +263,6 @@ else if($dopost=='save')
$win = new OxWindow();
$win->AddTitle("成功更改文章:");
$win->AddMsgItem($msg);
- $winform = $win->GetWindow("hand"," ",false);
+ $winform = $win->GetWindow("hand", " ", false);
$win->Display();
-}
\ No newline at end of file
+}
diff --git a/src/dede/article_keywords_main.php b/src/dede/article_keywords_main.php
index 832b38d9..33734451 100755
--- a/src/dede/article_keywords_main.php
+++ b/src/dede/article_keywords_main.php
@@ -1,104 +1,93 @@
ExecuteNoneQuery("DELETE FROM `#@__keywords` WHERE aid='$aid'");
continue;
}
//禁用项目
- $staold = ${'staold_'.$aid};
- $sta = empty(${'isnouse_'.$aid}) ? 1 : 0;
- if($staold!=$sta)
- {
+ $staold = ${'staold_' . $aid};
+ $sta = empty(${'isnouse_' . $aid}) ? 1 : 0;
+ if ($staold != $sta) {
$query1 = "UPDATE `#@__keywords` SET sta='$sta',rpurl='$rpurl' WHERE aid='$aid' ";
$dsql->ExecuteNoneQuery($query1);
continue;
}
//更新链接网址
- if($rpurl!=$rpurlold)
- {
+ if ($rpurl != $rpurlold) {
$query1 = "UPDATE `#@__keywords` SET rpurl='$rpurl' WHERE aid='$aid' ";
$dsql->ExecuteNoneQuery($query1);
}
}
- ShowMsg("完成指定的更改!",$ENV_GOBACK_URL);
+ ShowMsg("完成指定的更改!", $ENV_GOBACK_URL);
exit();
}
//增加关键字
-else if($dopost=='add')
-{
+else if ($dopost == 'add') {
$ENV_GOBACK_URL = empty($_COOKIE['ENV_GOBACK_URL']) ? "-1" : $_COOKIE['ENV_GOBACK_URL'];
$keyword = trim($keyword);
$rank = preg_replace("#[^0-9]#", '', $rank);
- if($keyword=='')
- {
- ShowMsg("关键字不能为空!",-1);
+ if ($keyword == '') {
+ ShowMsg("关键字不能为空!", -1);
exit();
}
$row = $dsql->GetOne("SELECT * FROM `#@__keywords` WHERE keyword LIKE '$keyword'");
- if(is_array($row))
- {
- ShowMsg("关键字已存在库中!","-1");
+ if (is_array($row)) {
+ ShowMsg("关键字已存在库中!", "-1");
exit();
}
$inquery = "INSERT INTO `#@__keywords`(keyword,rank,sta,rpurl) VALUES ('$keyword','$rank','1','$rpurl');";
$dsql->ExecuteNoneQuery($inquery);
- ShowMsg("成功增加一个关键字!",$ENV_GOBACK_URL);
+ ShowMsg("成功增加一个关键字!", $ENV_GOBACK_URL);
exit();
}
-if(empty($keyword))
-{
+if (empty($keyword)) {
$keyword = '';
$addquery = '';
-}
-else
-{
+} else {
$addquery = " WHERE keyword LIKE '%$keyword%' ";
}
$sql = "SELECT * FROM `#@__keywords` $addquery ORDER BY rank DESC";
$dlist = new DataListCP();
$dlist->pageSize = 20;
-$dlist->SetParameter("keyword",$keyword);
-$dlist->SetTemplate(DEDEADMIN."/templets/article_keywords_main.htm");
+$dlist->SetParameter("keyword", $keyword);
+$dlist->SetTemplate(DEDEADMIN . "/templets/article_keywords_main.htm");
$dlist->SetSource($sql);
$dlist->Display();
function GetSta($sta)
{
- if($sta==1) return '';
+ if ($sta == 1) return '';
else return ' checked="1" ';
-}
\ No newline at end of file
+}
diff --git a/src/dede/article_keywords_make.php b/src/dede/article_keywords_make.php
index 9dbc3045..4acb5ddd 100755
--- a/src/dede/article_keywords_make.php
+++ b/src/dede/article_keywords_make.php
@@ -1,30 +1,29 @@
\r\n";
flush();
$ws = $wserr = $wsnew = "";
$dsql->SetQuery("SELECT * FROM `#@__keywords`");
$dsql->Execute();
- while($row = $dsql->GetObject())
- {
- if($row->sta==1) $ws[$row->keyword] = 1;
+ while ($row = $dsql->GetObject()) {
+ if ($row->sta == 1) $ws[$row->keyword] = 1;
else $wserr[$row->keyword] = 1;
}
echo "完成关键字数据库的载入!
\r\n";
@@ -33,36 +32,25 @@ if($dopost=='analyse')
flush();
$dsql->SetQuery("SELECT id,keywords FROM `#@__archives`");
$dsql->Execute();
- while($row = $dsql->GetObject())
- {
- $keywords = explode(',',trim($row->keywords));
+ while ($row = $dsql->GetObject()) {
+ $keywords = explode(',', trim($row->keywords));
$nerr = false;
$mykey = '';
- if(is_array($keywords))
- {
- foreach($keywords as $v)
- {
+ if (is_array($keywords)) {
+ foreach ($keywords as $v) {
$v = trim($v);
- if($v=='')
- {
+ if ($v == '') {
continue;
}
- if(isset($ws[$v]))
- {
- $mykey .= $v." ";
- }
- else if(isset($wsnew[$v]))
- {
- $mykey .= $v.' ';
+ if (isset($ws[$v])) {
+ $mykey .= $v . " ";
+ } else if (isset($wsnew[$v])) {
+ $mykey .= $v . ' ';
$wsnew[$v]++;
- }
- else if(isset($wserr[$v]))
- {
+ } else if (isset($wserr[$v])) {
$nerr = true;
- }
- else
- {
- $mykey .= $v." ";
+ } else {
+ $mykey .= $v . " ";
$wsnew[$v] = 1;
}
}
@@ -70,75 +58,59 @@ if($dopost=='analyse')
}
echo "完成档案数据库的处理!
\r\n";
flush();
- if(is_array($wsnew))
- {
+ if (is_array($wsnew)) {
echo "对关键字进行排序...
\r\n";
flush();
arsort($wsnew);
echo "把关键字保存到数据库...
\r\n";
flush();
- foreach($wsnew as $k=>$v)
- {
- if(strlen($k)>20)
- {
+ foreach ($wsnew as $k => $v) {
+ if (strlen($k) > 20) {
continue;
}
- $dsql->SetQuery("INSERT INTO `#@__keywords`(keyword,rank,sta,rpurl) VALUES('".addslashes($k)."','$v','1','')");
+ $dsql->SetQuery("INSERT INTO `#@__keywords`(keyword,rank,sta,rpurl) VALUES('" . addslashes($k) . "','$v','1','')");
$dsql->Execute();
}
echo "完成关键字的导入!
\r\n";
flush();
sleep(1);
- }
- else
- {
+ } else {
echo "没发现任何新的关键字!
\r\n";
flush();
sleep(1);
}
- ShowMsg('完成所有操作,现在转到关键字列表页!','article_keywords_main.php');
+ ShowMsg('完成所有操作,现在转到关键字列表页!', 'article_keywords_main.php');
exit();
}
//自动获取关键字(适用于默认的文章模型)
-else if($dopost=='fetch')
-{
- require_once(DEDEINC."/splitword.class.php");
- if(empty($startdd))
- {
+else if ($dopost == 'fetch') {
+ require_once(DEDEINC . "/splitword.class.php");
+ if (empty($startdd)) {
$startdd = 0;
}
- if(empty($pagesize))
- {
+ if (empty($pagesize)) {
$pagesize = 20;
}
- if(empty($totalnum))
- {
+ if (empty($totalnum)) {
$totalnum = 0;
}
//统计记录总数
- if($totalnum==0)
- {
+ if ($totalnum == 0) {
$row = $dsql->GetOne("SELECT COUNT(*) AS dd FROM `#@__archives` WHERE channel='1' ");
$totalnum = $row['dd'];
}
//获取记录,并分析关键字
- if($totalnum > $startdd+$pagesize)
- {
+ if ($totalnum > $startdd + $pagesize) {
$limitSql = " LIMIT $startdd,$pagesize";
- }
- else if(($totalnum-$startdd)>0)
- {
- $limitSql = " LIMIT $startdd,".($totalnum - $startdd);
- }
- else
- {
+ } else if (($totalnum - $startdd) > 0) {
+ $limitSql = " LIMIT $startdd," . ($totalnum - $startdd);
+ } else {
$limitSql = '';
}
$tjnum = $startdd;
- if($limitSql!='')
- {
+ if ($limitSql != '') {
$fquery = "SELECT arc.id,arc.title,arc.keywords,addon.body FROM `#@__archives` arc
LEFT JOIN `#@__addonarticle` addon ON addon.aid=arc.id WHERE arc.channel='1' $limitSql ";
$dsql->SetQuery($fquery);
@@ -148,104 +120,84 @@ else if($dopost=='fetch')
$client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port);
$client->appid = $cfg_bizcore_appid;
$client->key = $cfg_bizcore_key;
- while($row=$dsql->GetObject())
- {
- if($row->keywords!='')
- {
+ while ($row = $dsql->GetObject()) {
+ if ($row->keywords != '') {
continue;
}
$tjnum++;
$id = $row->id;
$keywords = "";
- $data = $client->Spliteword($row->title.Html2Text($row->body));
+ $data = $client->Spliteword($row->title . Html2Text($row->body));
$keywords = $data->data;
$keywords = addslashes($keywords);
- if($keywords=='')
- {
+ if ($keywords == '') {
$keywords = ',';
}
$dsql->ExecuteNoneQuery("UPDATE `#@__archives` SET keywords='$keywords' WHERE id='$id'");
}
$client->Close();
} else {
- $sp = new SplitWord($cfg_soft_lang , $cfg_soft_lang );
- while($row=$dsql->GetObject())
- {
- if($row->keywords!='')
- {
+ $sp = new SplitWord($cfg_soft_lang, $cfg_soft_lang);
+ while ($row = $dsql->GetObject()) {
+ if ($row->keywords != '') {
continue;
}
$tjnum++;
$id = $row->id;
$keywords = "";
-
- $sp->SetSource($row->title, $cfg_soft_lang , $cfg_soft_lang );
+
+ $sp->SetSource($row->title, $cfg_soft_lang, $cfg_soft_lang);
$sp->SetResultType(2);
$sp->StartAnalysis(TRUE);
-
+
$titleindexs = $sp->GetFinallyIndex();
-
- $sp->SetSource(Html2Text($row->body), $cfg_soft_lang , $cfg_soft_lang );
+
+ $sp->SetSource(Html2Text($row->body), $cfg_soft_lang, $cfg_soft_lang);
$sp->SetResultType(2);
$sp->StartAnalysis(TRUE);
$allindexs = $sp->GetFinallyIndex();
- if(is_array($allindexs) && is_array($titleindexs))
- {
- foreach($titleindexs as $k => $v)
- {
- if(strlen($keywords)>=30)
- {
+ if (is_array($allindexs) && is_array($titleindexs)) {
+ foreach ($titleindexs as $k => $v) {
+ if (strlen($keywords) >= 30) {
break;
- }
- else
- {
- if(strlen($k) <= 2) continue;
- $keywords .= $k.",";
+ } else {
+ if (strlen($k) <= 2) continue;
+ $keywords .= $k . ",";
}
}
- foreach($allindexs as $k => $v)
- {
- if(strlen($keywords)>=30)
- {
+ foreach ($allindexs as $k => $v) {
+ if (strlen($keywords) >= 30) {
break;
- }
- else if(!in_array($k,$titleindexs))
- {
- if(strlen($k) <= 2) continue;
- $keywords .= $k.",";
+ } else if (!in_array($k, $titleindexs)) {
+ if (strlen($k) <= 2) continue;
+ $keywords .= $k . ",";
}
}
}
$keywords = addslashes($keywords);
- if($keywords=='')
- {
+ if ($keywords == '') {
$keywords = ',';
}
$dsql->ExecuteNoneQuery("UPDATE `#@__archives` SET keywords='$keywords' WHERE id='$id'");
}
unset($sp);
}
-
-
- }//end if limit
+ } //end if limit
//返回提示信息
- if($totalnum>0) $tjlen = ceil( ($tjnum/$totalnum) * 100 );
- else $tjlen=100;
+ if ($totalnum > 0) $tjlen = ceil(($tjnum / $totalnum) * 100);
+ else $tjlen = 100;
$dvlen = $tjlen * 2;
$tjsta = "
";
$tjsta .= "
完成处理文档总数的:$tjlen %,位置:{$startdd},继续执行任务...";
- if($tjnum < $totalnum)
- {
- $nurl = "article_keywords_make.php?dopost=fetch&totalnum=$totalnum&startdd=".($startdd+$pagesize)."&pagesize=$pagesize";
- ShowMsg($tjsta,$nurl,0,500);
- }
- else
- {
- ShowMsg("完成所有任务!","javascript:;");
+ if ($tjnum < $totalnum) {
+ $nurl = "article_keywords_make.php?dopost=fetch&totalnum=$totalnum&startdd=" . ($startdd + $pagesize) . "&pagesize=$pagesize";
+ ShowMsg($tjsta, $nurl, 0, 500);
+ } else {
+ ShowMsg("完成所有任务!", "javascript:;");
}
exit();
}
diff --git a/src/dede/article_keywords_select.php b/src/dede/article_keywords_select.php
index 4360cd1f..3012ee53 100755
--- a/src/dede/article_keywords_select.php
+++ b/src/dede/article_keywords_select.php
@@ -1,37 +1,38 @@
SetTemplate(DEDEADMIN."/templets/article_keywords_select.htm");
+$dlist->SetTemplate(DEDEADMIN . "/templets/article_keywords_select.htm");
$dlist->pageSize = 300;
-$dlist->SetParameter("f",$f);
+$dlist->SetParameter("f", $f);
$dlist->SetSource($sql);
$dlist->Display();
function GetSta($sta)
{
- if($sta==1) return "正常";
+ if ($sta == 1) return "正常";
else return "
禁用";
}
function GetMan($sta)
{
- if($sta==1) return "
禁用";
+ if ($sta == 1) return "
禁用";
else return "
启用";
-}
\ No newline at end of file
+}
diff --git a/src/dede/article_select_sw.php b/src/dede/article_select_sw.php
index 67560420..5337df4f 100755
--- a/src/dede/article_select_sw.php
+++ b/src/dede/article_select_sw.php
@@ -1,53 +1,46 @@
[
设置] ";
echo "[
关闭]
\r\n