Browse Source

代码格式化、确认DedeBIZ包名

tags/6.0.2
tianya 3 months ago
parent
commit
892752ef1c
100 changed files with 3938 additions and 5127 deletions
  1. +1
    -3
      src/data/admin/allowurl.txt
  2. +2
    -1
      src/data/admin/config_update.php
  3. +6
    -5
      src/dede/action_search.php
  4. +32
    -34
      src/dede/actionsearch_class.php
  5. +27
    -48
      src/dede/ad_add.php
  6. +21
    -29
      src/dede/ad_edit.php
  7. +21
    -28
      src/dede/ad_main.php
  8. +13
    -19
      src/dede/adtype_main.php
  9. +159
    -199
      src/dede/album_add.php
  10. +165
    -205
      src/dede/album_edit.php
  11. +4
    -3
      src/dede/album_testhtml.php
  12. +93
    -118
      src/dede/archives_add.php
  13. +402
    -520
      src/dede/archives_do.php
  14. +84
    -109
      src/dede/archives_edit.php
  15. +70
    -94
      src/dede/archives_sg_add.php
  16. +65
    -84
      src/dede/archives_sg_edit.php
  17. +1
    -3
      src/dede/article_add.php
  18. +17
    -18
      src/dede/article_allowurl_edit.php
  19. +86
    -96
      src/dede/article_coonepage_rule.php
  20. +57
    -92
      src/dede/article_description_main.php
  21. +98
    -124
      src/dede/article_edit.php
  22. +31
    -42
      src/dede/article_keywords_main.php
  23. +68
    -116
      src/dede/article_keywords_make.php
  24. +11
    -10
      src/dede/article_keywords_select.php
  25. +16
    -23
      src/dede/article_select_sw.php
  26. +17
    -18
      src/dede/article_source_edit.php
  27. +19
    -20
      src/dede/article_string_mix.php
  28. +24
    -31
      src/dede/article_template_rand.php
  29. +44
    -49
      src/dede/article_test_same.php
  30. +6
    -6
      src/dede/article_test_title.php
  31. +17
    -18
      src/dede/article_writer_edit.php
  32. +19
    -25
      src/dede/baidunews.php
  33. +20
    -29
      src/dede/cards_make.php
  34. +26
    -26
      src/dede/cards_manage.php
  35. +15
    -21
      src/dede/cards_type.php
  36. +94
    -130
      src/dede/catalog_add.php
  37. +17
    -17
      src/dede/catalog_del.php
  38. +1
    -1
      src/dede/catalog_do.php
  39. +141
    -158
      src/dede/catalog_edit.php
  40. +5
    -4
      src/dede/catalog_main.php
  41. +9
    -11
      src/dede/catalog_menu.php
  42. +54
    -80
      src/dede/co_add.php
  43. +79
    -124
      src/dede/co_do.php
  44. +48
    -76
      src/dede/co_edit.php
  45. +9
    -11
      src/dede/co_edit_text.php
  46. +73
    -132
      src/dede/co_export.php
  47. +1
    -3
      src/dede/co_export_corule.php
  48. +8
    -11
      src/dede/co_gather_start.php
  49. +35
    -51
      src/dede/co_gather_start_action.php
  50. +1
    -3
      src/dede/co_get_corule.php
  51. +32
    -49
      src/dede/co_getsource_url_action.php
  52. +8
    -7
      src/dede/co_main.php
  53. +5
    -4
      src/dede/co_test_rule.php
  54. +17
    -22
      src/dede/co_url.php
  55. +13
    -16
      src/dede/co_view.php
  56. +65
    -78
      src/dede/config.php
  57. +10
    -11
      src/dede/content_att.php
  58. +5
    -4
      src/dede/content_batch_up.php
  59. +67
    -96
      src/dede/content_batchup_action.php
  60. +3
    -2
      src/dede/content_i_list.php
  61. +61
    -96
      src/dede/content_list.php
  62. +4
    -3
      src/dede/content_s_list.php
  63. +3
    -2
      src/dede/content_select_list.php
  64. +31
    -45
      src/dede/content_sg_list.php
  65. +14
    -23
      src/dede/content_tj.php
  66. +22
    -25
      src/dede/dialog/config.php
  67. +105
    -105
      src/dede/dialog/select_images.php
  68. +43
    -56
      src/dede/dialog/select_images_post.php
  69. +1
    -1
      src/dede/dialog/select_media.php
  70. +1
    -1
      src/dede/dialog/select_media_post.php
  71. +1
    -1
      src/dede/dialog/select_soft.php
  72. +1
    -1
      src/dede/dialog/select_soft_post.php
  73. +114
    -114
      src/dede/dialog/select_templets.php
  74. +19
    -26
      src/dede/dialog/select_templets_post.php
  75. +23
    -36
      src/dede/diy_add.php
  76. +18
    -23
      src/dede/diy_edit.php
  77. +32
    -44
      src/dede/diy_field_add.php
  78. +39
    -57
      src/dede/diy_field_edit.php
  79. +65
    -115
      src/dede/diy_list.php
  80. +8
    -7
      src/dede/diy_main.php
  81. +26
    -35
      src/dede/erraddsave.php
  82. +7
    -9
      src/dede/exit.php
  83. +16
    -17
      src/dede/feedback_edit.php
  84. +4
    -3
      src/dede/feedback_main.php
  85. +2
    -2
      src/dede/file_class.php
  86. +38
    -59
      src/dede/file_manage_control.php
  87. +10
    -12
      src/dede/file_manage_main.php
  88. +55
    -67
      src/dede/file_manage_view.php
  89. +23
    -27
      src/dede/freelist_add.php
  90. +25
    -28
      src/dede/freelist_edit.php
  91. +1
    -3
      src/dede/freelist_main.php
  92. +23
    -32
      src/dede/friendlink_add.php
  93. +36
    -47
      src/dede/friendlink_edit.php
  94. +14
    -13
      src/dede/friendlink_main.php
  95. +13
    -19
      src/dede/friendlink_type.php
  96. +0
    -19
      src/dede/getdedesysmsg.php
  97. +49
    -64
      src/dede/imagecut.php
  98. +292
    -291
      src/dede/inc/inc_action_info.php
  99. +141
    -231
      src/dede/inc/inc_archives_all.php
  100. +1
    -1
      src/dede/inc/inc_archives_functions.php

+ 1
- 3
src/data/admin/allowurl.txt View File

@@ -1,4 +1,2 @@
www.dedebiz.com
www.zhelixie.com
www.dedecms.com
bbs.dedecms.com
www.zhelixie.com

+ 2
- 1
src/data/admin/config_update.php View File

@@ -1,7 +1,8 @@
<?php
/**
* @version $Id: config_update.php 1 11:36 2011-2-21 tianya $
* @package DedeCMS.Administrator
* @package DedeBIZ.Administrator
* @copyright Copyright (c) 2020, DedeBIZ.COM
* @license https://www.dedebiz.com/license
* @link https://www.dedebiz.com


+ 6
- 5
src/dede/action_search.php View File

@@ -1,20 +1,21 @@
<?php
/**
* 检索操作
*
* @version $Id: action_search.php 1 8:26 2010年7月12日Z tianya $
* @package DedeCMS.Administrator
* @package DedeBIZ.Administrator
* @copyright Copyright (c) 2020, DedeBIZ.COM
* @license https://www.dedebiz.com/license
* @link https://www.dedebiz.com
*/
require_once(dirname(__FILE__)."/config.php");
require_once(dirname(__FILE__)."/actionsearch_class.php");
require_once(dirname(__FILE__) . "/config.php");
require_once(dirname(__FILE__) . "/actionsearch_class.php");
//增加权限检查
if(empty($dopost)) $dopost = "";
if (empty($dopost)) $dopost = "";
$keyword=empty($keyword)? "" : RemoveXss($keyword);
$keyword = empty($keyword) ? "" : RemoveXss($keyword);
$actsearch = new ActionSearch($keyword);
$asresult = $actsearch->Search();
include DedeInclude('templets/action_search.htm');

+ 32
- 34
src/dede/actionsearch_class.php View File

@@ -1,12 +1,13 @@
<?php
/**
* @version $Id: actionsearch_class.php 1 8:26 2010年7月12日Z tianya $
* @package DedeCMS.Administrator
* @package DedeBIZ.Administrator
* @copyright Copyright (c) 2020, DedeBIZ.COM
* @license https://www.dedebiz.com/license
* @link https://www.dedebiz.com
*/
class ActionSearch
class ActionSearch
{
var $keyword;
var $asarray = array();
@@ -17,43 +18,41 @@ class ActionSearch
$this->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,'<font color="red">'.$this->keyword.'</font>',$text[$key]);
}
$text[$key] = str_replace($this->keyword, '<font color="red">' . $this->keyword . '</font>', $text[$key]);
}
}
} else {
$text = str_replace($this->keyword,'<font color="red">'.$this->keyword.'</font>',$text);
$text = str_replace($this->keyword, '<font color="red">' . $this->keyword . '</font>', $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);
}
}
}

+ 27
- 48
src/dede/ad_add.php View File

@@ -1,78 +1,58 @@
<?php

/**
* 广告添加
*
* @version $Id: ad_add.php 1 8:26 2010年7月12日Z tianya $
* @package DedeCMS.Administrator
* @package DedeBIZ.Administrator
* @copyright Copyright (c) 2020, DedeBIZ.COM
* @license https://www.dedebiz.com/license
* @link https://www.dedebiz.com
*/
require(dirname(__FILE__)."/config.php");
require(dirname(__FILE__) . "/config.php");
CheckPurview('plus_广告管理');
require_once DEDEINC."/typelink.class.php";
if(empty($dopost)) $dopost = "";
require_once DEDEINC . "/typelink.class.php";
if (empty($dopost)) $dopost = "";

if($dopost=="save")
{
if ($dopost == "save") {
CheckCSRF();
//timeset tagname typeid normbody expbody
$tagname = trim($tagname);
$row = $dsql->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 = "<a href=\"{$link}\" font-size=\"{$normbody['size']}\" color=\"{$normbody['color']}\">{$normbody['title']}</a>";
}
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 = "<a href=\"{$link}\"><img src=\"{$normbody['url']}\"$width $height border=\"0\" /></a>";
}
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 = "<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>";
@@ -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 .= "<option value='{$arr['id']}'>{$arr['typename']}</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');
include DedeInclude('templets/ad_add.htm');

+ 21
- 29
src/dede/ad_edit.php View File

@@ -1,35 +1,33 @@
<?php

/**
* 广告编辑
*
* @version $Id: ad_edit.php 1 8:26 2010年7月12日Z tianya $
* @package DedeCMS.Administrator
* @package DedeBIZ.Administrator
* @copyright Copyright (c) 2020, DedeBIZ.COM
* @license https://www.dedebiz.com/license
* @link https://www.dedebiz.com
*/
require(dirname(__FILE__)."/config.php");
require(dirname(__FILE__) . "/config.php");
CheckPurview('plus_广告管理');
require_once(DEDEINC.'/typelink.class.php');
if(empty($dopost)) $dopost = '';
require_once(DEDEINC . '/typelink.class.php');
if (empty($dopost)) $dopost = '';
$aid = preg_replace("#[^0-9]#", '', $aid);
$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("成功删除一则广告代码!",$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 = "<script src='{$cfg_phpurl}/ad_js.php?aid=$aid' language='javascript'></script>";
$showhtml = "<xmp style='color:#333333;background-color:#ffffff'>\r\n\r\n$jscode\r\n\r\n</xmp>";
$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 = "<b>说明:</b>如果嵌入的是织梦CMS广告标签,那么将会解析成标签中的内容到页面,广告更改后需要重新生成。<br />
如果不希望重新生成所有页面,则直接调用JS代码即可。
";
@@ -37,22 +35,18 @@ else if($dopost=="gettag")
$wecome_info = "<a href='ad_main.php'><u>广告管理</u></a>::获取JS";
$win = new OxWindow();
$win->Init();
$winform = $win->GetWindow("hand",$info);
$winform = $win->GetWindow("hand", $info);
$win->AddTitle("织梦CMS标签调用代码:");
$winform = $win->GetWindow("hand",$showtag);
$winform = $win->GetWindow("hand", $showtag);
$win->myWinItem = '';
$win->AddTitle("以下为选定广告的JS调用代码:");
$winform = $win->GetWindow("hand",$showhtml);
$winform = $win->GetWindow("hand", $showhtml);
$win->Display();
exit();
}
else if($dopost=='testjs')
{
} else if ($dopost == 'testjs') {
echo "<script src='{$cfg_phpurl}/ad_js.php?aid=$aid&nocache=1' language='javascript'></script>";
exit();
}
else if($dopost=='saveedit')
{
} else if ($dopost == 'saveedit') {
CheckCSRF();
$starttime = GetMkTime($starttime);
$endtime = GetMkTime($endtime);
@@ -69,20 +63,18 @@ else if($dopost=='saveedit')
WHERE aid='$aid'
";
$dsql->ExecuteNoneQuery($query);
ShowMsg("成功更改一则广告代码!",$ENV_GOBACK_URL);
ShowMsg("成功更改一则广告代码!", $ENV_GOBACK_URL);
exit();
}

$row = $dsql->GetOne("SELECT * FROM `#@__myad` WHERE aid='$aid'");
$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'))
{
if ($arr['id'] == $row['clsid'])
{
while ($arr = $dsql->GetArray('dd')) {
if ($arr['id'] == $row['clsid']) {
$option .= "<option value='{$arr['id']}' selected='selected'>{$arr['typename']}</option>\n\r";
} else {
$option .= "<option value='{$arr['id']}'>{$arr['typename']}</option>\n\r";
}
}
include DedeInclude('templets/ad_edit.htm');
include DedeInclude('templets/ad_edit.htm');

+ 21
- 28
src/dede/ad_main.php View File

@@ -1,35 +1,34 @@
<?php
/**
* 广告管理
*
* @version $Id: ad_main.php 1 8:26 2010年7月12日Z tianya $
* @package DedeCMS.Administrator
* @package DedeBIZ.Administrator
* @copyright Copyright (c) 2020, DedeBIZ.COM
* @license https://www.dedebiz.com/license
* @link https://www.dedebiz.com
*/
require_once(dirname(__FILE__).'/config.php');
require_once(DEDEINC.'/datalistcp.class.php');
require_once(DEDEINC.'/common.func.php');
setcookie('ENV_GOBACK_URL',$dedeNowurl,time()+3600,'/');
require_once(dirname(__FILE__) . '/config.php');
require_once(DEDEINC . '/datalistcp.class.php');
require_once(DEDEINC . '/common.func.php');
setcookie('ENV_GOBACK_URL', $dedeNowurl, time() + 3600, '/');
$clsid = isset($clsid)? intval($clsid) : 0;
$keyword = isset($keyword)? addslashes($keyword) : '';
$clsid = isset($clsid) ? intval($clsid) : 0;
$keyword = isset($keyword) ? addslashes($keyword) : '';
$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'))
{
if ($arr['id'] == $clsid)
{
while ($arr = $dsql->GetArray('dd')) {
if ($arr['id'] == $clsid) {
$option .= "<option value='{$arr['id']}' selected='selected'>{$arr['typename']}</option>\n\r";
} else {
$option .= "<option value='{$arr['id']}'>{$arr['typename']}</option>\n\r";
}
}
$where_sql = ' 1=1';
if($clsid!=0) $where_sql .= " AND clsid = $clsid";
if($keyword!='') $where_sql .= " AND (ad.adname like '%$keyword%') ";
if ($clsid != 0) $where_sql .= " AND clsid = $clsid";
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
@@ -38,30 +37,24 @@ LEFT JOIN `#@__myadtype` ap on ap.id=ad.clsid
WHERE $where_sql
ORDER BY ad.aid desc";
$dlist = new DataListCP();
$dlist->SetTemplet(DEDEADMIN."/templets/ad_main.htm");
$dlist->SetTemplet(DEDEADMIN . "/templets/ad_main.htm");
$dlist->SetSource($sql);
$dlist->display();
function TestType($tname, $type="")
function TestType($tname, $type = "")
{
if($tname=="")
{
return ($type == 1)? "默认分类" : "所有栏目";
}
else
{
if ($tname == "") {
return ($type == 1) ? "默认分类" : "所有栏目";
} else {
return $tname;
}
}
function TimeSetValue($ts)
{
if($ts==0)
{
if ($ts == 0) {
return "不限时间";
}
else
{
} else {
return "限时标记";
}
}
}

+ 13
- 19
src/dede/adtype_main.php View File

@@ -1,43 +1,37 @@
<?php
/**
* 友情链接类型
*
* @version $Id: friendlink_type.php 1 8:48 2010年7月13日Z tianya $
* @package DedeCMS.Administrator
* @package DedeBIZ.Administrator
* @copyright Copyright (c) 2020, DedeBIZ.COM
* @license https://www.dedebiz.com/license
* @link https://www.dedebiz.com
*/
require_once(dirname(__FILE__)."/config.php");
if(empty($dopost)) $dopost = '';
require_once(dirname(__FILE__) . "/config.php");
if (empty($dopost)) $dopost = '';
//保存更改
if($dopost=="save")
{
if ($dopost == "save") {
$startID = 1;
$endID = $idend;
for(;$startID<=$endID;$startID++)
{
for (; $startID <= $endID; $startID++) {
$query = '';
$tid = ${'ID_'.$startID};
$pname = ${'pname_'.$startID};
if(isset(${'check_'.$startID}))
{
if($pname!='')
{
$tid = ${'ID_' . $startID};
$pname = ${'pname_' . $startID};
if (isset(${'check_' . $startID})) {
if ($pname != '') {
$query = "UPDATE `#@__myadtypee` SET typename='$pname' WHERE id='$tid' ";
$dsql->ExecuteNoneQuery($query);
}
}
else
{
} else {
$query = "DELETE FROM `#@__myadtype` WHERE id='$tid' ";
$dsql->ExecuteNoneQuery($query);
}
}
//增加新记录
if(isset($check_new) && $pname_new!='')
{
if (isset($check_new) && $pname_new != '') {
$query = "INSERT INTO `#@__myadtype`(typename) VALUES('{$pname_new}');";
$dsql->ExecuteNoneQuery($query);
}
@@ -46,4 +40,4 @@ if($dopost=="save")
exit;
}
include DedeInclude('templets/adtype_main.htm');
include DedeInclude('templets/adtype_main.htm');

+ 159
- 199
src/dede/album_add.php View File

@@ -1,43 +1,40 @@
<?php
/**
* 图集发布
*
* @version $Id: album_add.php 1 8:26 2010年7月12日Z tianya $
* @package DedeCMS.Administrator
* @package DedeBIZ.Administrator
* @copyright Copyright (c) 2020, 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");
CheckPurview('a_New,a_AccNew');
require_once(DEDEINC."/customfields.func.php");
require_once(DEDEADMIN."/inc/inc_archives_functions.php");
require_once(DEDEINC . "/customfields.func.php");
require_once(DEDEADMIN . "/inc/inc_archives_functions.php");
if(empty($dopost)) $dopost = '';
if (empty($dopost)) $dopost = '';
if($dopost != 'save')
{
require_once(DEDEINC."/dedetag.class.php");
require_once(DEDEADMIN."/inc/inc_catalog_options.php");
if ($dopost != 'save') {
require_once(DEDEINC . "/dedetag.class.php");
require_once(DEDEADMIN . "/inc/inc_catalog_options.php");
ClearMyAddon();
$channelid = empty($channelid) ? 0 : intval($channelid);
$cid = empty($cid) ? 0 : intval($cid);
//获得频道模型ID
if($cid>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) $channelid = 2;
} else {
if ($channelid == 0) $channelid = 2;
}
//获得频道模型信息
$cInfos = $dsql->GetOne(" SELECT * FROM `#@__channeltype` WHERE id='$channelid' ");
$channelid = $cInfos['id'];
//获取文章最大id以确定当前权重
$maxWright = $dsql->GetOne("SELECT COUNT(*) AS cc FROM #@__archives");
include DedeInclude("templets/album_add.htm");
@@ -45,122 +42,112 @@ 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($click)) $click = ($cfg_arc_click=='-1' ? mt_rand(50, 200) : $cfg_arc_click);
if(!isset($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($formhtml)) $formhtml = 0;
if(!isset($formzip)) $formzip = 0;
if(!isset($ddisfirst)) $ddisfirst = 0;
if(!isset($albums)) $albums = "";
if(!isset($delzip)) $delzip = 0;
if(empty($click)) $click = ($cfg_arc_click=='-1' ? mt_rand(50, 200) : $cfg_arc_click);
if($typeid==0)
{
-------------------------------*/ 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($click)) $click = ($cfg_arc_click == '-1' ? mt_rand(50, 200) : $cfg_arc_click);
if (!isset($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($formhtml)) $formhtml = 0;
if (!isset($formzip)) $formzip = 0;
if (!isset($ddisfirst)) $ddisfirst = 0;
if (!isset($albums)) $albums = "";
if (!isset($delzip)) $delzip = 0;
if (empty($click)) $click = ($cfg_arc_click == '-1' ? mt_rand(50, 200) : $cfg_arc_click);
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($writer)) $writer = $cuserLogin->getUserName();
if (empty($source)) $source = '未知';
$pubdate = GetMkTime($pubdate);
$senddate = time();
$sortrank = AddDay($pubdate,$sortup);
$ismake = $ishtml==0 ? -1 : 0;
$sortrank = AddDay($pubdate, $sortup);
$ismake = $ishtml == 0 ? -1 : 0;
$title = preg_replace("#\"#", '"', $title);
$title = 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,$cfg_auot_description);
$keywords = cn_substrR($keywords,60);
$filename = trim(cn_substrR($filename,40));
$title = 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, $cfg_auot_description);
$keywords = cn_substrR($keywords, 60);
$filename = trim(cn_substrR($filename, 40));
$userip = GetIP();
$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)) $ddisremote = 0;
$litpic = GetDDImage('none',$picname,$ddisremote);
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;
}
// 处理新的缩略图上传
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($ddisfirst==1 && $litpic=='')
{
if(isset($imgurl1))
{
if ($ddisfirst == 1 && $litpic == '') {
if (isset($imgurl1)) {
$litpic = GetDDImage('ddfirst', $imgurl1, $isrm);
}
}
//生成文档ID
$arcID = GetIndexKey($arcrank,$typeid,$sortrank,$channelid,$senddate,$adminid);
if(empty($arcID))
{
ShowMsg("无法获得主键,因此无法进行后续操作!","-1");
$arcID = GetIndexKey($arcrank, $typeid, $sortrank, $channelid, $senddate, $adminid);
if (empty($arcID)) {
ShowMsg("无法获得主键,因此无法进行后续操作!", "-1");
exit();
}
@@ -171,12 +158,10 @@ else if($dopost=='save')
/*---------------------
function _getformhtml()
------------------*/
if($formhtml==1)
{
if ($formhtml == 1) {
$imagebody = stripslashes($imagebody);
$imgurls .= GetCurContentAlbum($imagebody,$copysource,$litpicname);
if($ddisfirst==1 && $litpic=='' && !empty($litpicname))
{
$imgurls .= GetCurContentAlbum($imagebody, $copysource, $litpicname);
if ($ddisfirst == 1 && $litpic == '' && !empty($litpicname)) {
$litpic = $litpicname;
$hasone = TRUE;
}
@@ -185,64 +170,56 @@ else if($dopost=='save')
function _getformzip()
处理从ZIP中解压的图片
---------------------*/
if($formzip==1)
{
include_once(DEDEINC."/zip.class.php");
include_once(DEDEADMIN."/file_class.php");
$zipfile = $cfg_basedir.str_replace($cfg_mainsite,'',$zipfile);
$tmpzipdir = DEDEDATA.'/ziptmp/'.cn_substr(md5(ExecTime()),16);
if ($formzip == 1) {
include_once(DEDEINC . "/zip.class.php");
include_once(DEDEADMIN . "/file_class.php");
$zipfile = $cfg_basedir . str_replace($cfg_mainsite, '', $zipfile);
$tmpzipdir = DEDEDATA . '/ziptmp/' . cn_substr(md5(ExecTime()), 16);
$ntime = time();
if(file_exists($zipfile))
{
@mkdir($tmpzipdir,$GLOBALS['cfg_dir_purview']);
@chmod($tmpzipdir,$GLOBALS['cfg_dir_purview']);
if (file_exists($zipfile)) {
@mkdir($tmpzipdir, $GLOBALS['cfg_dir_purview']);
@chmod($tmpzipdir, $GLOBALS['cfg_dir_purview']);
$z = new zip();
$z->ExtractAll($zipfile,$tmpzipdir);
$z->ExtractAll($zipfile, $tmpzipdir);
$fm = new FileManagement();
$imgs = array();
$fm->GetMatchFiles($tmpzipdir,"jpg|png|gif",$imgs);
$fm->GetMatchFiles($tmpzipdir, "jpg|png|gif", $imgs);
$i = 0;
foreach($imgs as $imgold)
{
foreach ($imgs as $imgold) {
$i++;
$savepath = $cfg_image_dir."/".MyDate("Y-m",$ntime);
$savepath = $cfg_image_dir . "/" . MyDate("Y-m", $ntime);
CreateDir($savepath);
$iurl = $savepath."/".MyDate("d",$ntime).dd2char(MyDate("His",$ntime).'-'.$adminid."-{$i}".mt_rand(1000,9999));
$iurl = $iurl.substr($imgold,-4,4);
$imgfile = $cfg_basedir.$iurl;
copy($imgold,$imgfile);
$iurl = $savepath . "/" . MyDate("d", $ntime) . dd2char(MyDate("His", $ntime) . '-' . $adminid . "-{$i}" . mt_rand(1000, 9999));
$iurl = $iurl . substr($imgold, -4, 4);
$imgfile = $cfg_basedir . $iurl;
copy($imgold, $imgfile);
unlink($imgold);
if(is_file($imgfile))
{
$litpicname = $pagestyle > 2 ? GetImageMapDD($iurl,$cfg_ddimg_width) : $iurl;
if (is_file($imgfile)) {
$litpicname = $pagestyle > 2 ? GetImageMapDD($iurl, $cfg_ddimg_width) : $iurl;
//指定了提取第一张为缩略图的情况强制使用第一张缩略图
if($i=='1')
{
if(!$hasone && $ddisfirst==1 && $litpic=='' && empty($litpicname))
{
$litpicname = GetImageMapDD($iurl,$cfg_ddimg_width);
if ($i == '1') {
if (!$hasone && $ddisfirst == 1 && $litpic == '' && empty($litpicname)) {
$litpicname = GetImageMapDD($iurl, $cfg_ddimg_width);
}
}
$info = '';
$imginfos = GetImageSize($imgfile,$info);
$imgurls .= "{dede:img ddimg='$litpicname' text='' width='".$imginfos[0]."' height='".$imginfos[1]."'} $iurl {/dede:img}\r\n";
$imginfos = GetImageSize($imgfile, $info);
$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');
VALUES ('{$title}','{$iurl}','1','" . $imginfos[0] . "','" . $imginfos[1] . "','0','" . filesize($imgfile) . "','" . $ntime . "','$adminid');
";
$dsql->ExecuteNoneQuery($inquery);
$fid = $dsql->GetLastID();
AddMyAddon($fid, $iurl);
WaterImg($imgfile, 'up');
if(!$hasone && $ddisfirst==1 && $litpic=='')
{
if(empty($litpicname))
{
if (!$hasone && $ddisfirst == 1 && $litpic == '') {
if (empty($litpicname)) {
$litpicname = $iurl;
$litpicname = GetImageMapDD($iurl, $cfg_ddimg_width);
}
@@ -251,140 +228,123 @@ else if($dopost=='save')
}
}
}
if($delzip==1) unlink($zipfile);
if ($delzip == 1) unlink($zipfile);
$fm->RmDirFiles($tmpzipdir);
}
}
if ($albums !== "") {
$albumsArr = json_decode(stripslashes( $albums), true);
$albumsArr = json_decode(stripslashes($albums), true);
for ($i=0; $i <= count($albumsArr) - 1; $i++) {
for ($i = 0; $i <= count($albumsArr) - 1; $i++) {
$album = $albumsArr[$i];
$data = explode( ',', $album['img'] );
$data = explode(',', $album['img']);
$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]));
$info = '';
$imginfos = GetImageSize($cfg_basedir.$fullUrl, $info);
$imginfos = GetImageSize($cfg_basedir . $fullUrl, $info);
$v = $fullUrl;
$imginfo = !empty($album['txt']) ? $album['txt'] : '';
$imgurls .= "{dede:img ddimg='$v' text='$imginfo' width='".$imginfos[0]."' height='".$imginfos[1]."'} $v {/dede:img}\r\n";
$imgurls .= "{dede:img ddimg='$v' text='$imginfo' width='" . $imginfos[0] . "' height='" . $imginfos[1] . "'} $v {/dede:img}\r\n";
}
}
$imgurls = addslashes($imgurls);
//处理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(!isset(${$vs[0]}))
{
$vs = explode(',', $v);
if (!isset(${$vs[0]})) {
${$vs[0]} = '';
}
else if($vs[1]=='htmltext'||$vs[1]=='textdata') //HTML文本特殊处理
{
${$vs[0]} = AnalyseHtmlBody(${$vs[0]},$description,$litpic,$keywords,$vs[1]);
}
else
} else 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');
}
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;
//加入主档案表
$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();
$dsql->ExecuteNoneQuery(" DELETE FROM `#@__arctiny` WHERE id='$arcID' ");
ShowMsg("把数据保存到数据库主表 `#@__archives` 时出错,请把相关信息提交给DedeCMS官方。".str_replace('"','',$gerr),"javascript:;");
ShowMsg("把数据保存到数据库主表 `#@__archives` 时出错,请把相关信息提交给DedeCMS官方。" . str_replace('"', '', $gerr), "javascript:;");
exit();
}
//加入附加表
$cts = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid' ");
$addtable = trim($cts['addtable']);
if(empty($addtable))
{
if (empty($addtable)) {
$dsql->ExecuteNoneQuery("DELETE FROM `#@__archives` WHERE id='$arcID'");
$dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'");
ShowMsg("没找到当前模型[{$channelid}]的主表信息,无法完成操作!。","javascript:;");
ShowMsg("没找到当前模型[{$channelid}]的主表信息,无法完成操作!。", "javascript:;");
exit();
}
$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}); ";
if(!$dsql->ExecuteNoneQuery($query))
{
if (!$dsql->ExecuteNoneQuery($query)) {
$gerr = $dsql->GetError();
$dsql->ExecuteNoneQuery("DELETE FROM `#@__archives` WHERE id='$arcID'");
$dsql->ExecuteNoneQuery("DELETE FROM `#@__arctiny` WHERE id='$arcID'");
ShowMsg("把数据保存到数据库附加表 `{$addtable}` 时出错,请把相关信息提交给DedeCMS官方。".str_replace('"','',$gerr),"javascript:;");
ShowMsg("把数据保存到数据库附加表 `{$addtable}` 时出错,请把相关信息提交给DedeCMS官方。" . str_replace('"', '', $gerr), "javascript:;");
exit();
}
//生成HTML
InsertTags($tags,$arcID);
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');
}else{
$config=array();
InsertTags($tags, $arcID);
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');
} else {
$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);
@@ -394,7 +354,7 @@ 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);
}
}
}
@@ -405,7 +365,7 @@ else if($dopost=='save')
  请选择你的后续操作:
<a href='album_add.php?cid=$typeid' class='btn btn-secondary btn-sm'>继续发布图片</a>
&nbsp;&nbsp;
<a href='archives_do.php?aid=".$arcID."&dopost=editArchives' class='btn btn-secondary btn-sm'>更改图集</a>
<a href='archives_do.php?aid=" . $arcID . "&dopost=editArchives' class='btn btn-secondary btn-sm'>更改图集</a>
&nbsp;&nbsp;
<a href='$artUrl' target='_blank' class='btn btn-secondary btn-sm'>预览文档</a>
&nbsp;&nbsp;
@@ -413,13 +373,13 @@ else if($dopost=='save')
&nbsp;&nbsp;
$backurl
";
$msg = "<div style=\"line-height:36px;height:36px\">{$msg}</div>".GetUpdateTest();
$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","&nbsp;",FALSE);
$winform = $win->GetWindow("hand", "&nbsp;", FALSE);
$win->Display();
}
}

+ 165
- 205
src/dede/album_edit.php View File

@@ -1,24 +1,24 @@
<?php
/**
* 图集编辑
*
* @version $Id: album_edit.php 1 8:26 2010年7月12日Z tianya $
* @package DedeCMS.Administrator
* @package DedeBIZ.Administrator
* @copyright Copyright (c) 2020, 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");
CheckPurview('a_Edit,a_AccEdit,a_MyEdit');
require_once(DEDEINC."/customfields.func.php");
require_once(DEDEADMIN."/inc/inc_archives_functions.php");
require_once(DEDEINC . "/customfields.func.php");
require_once(DEDEADMIN . "/inc/inc_archives_functions.php");
if(empty($dopost)) $dopost = '';
if (empty($dopost)) $dopost = '';
if($dopost!='save')
{
require_once(DEDEADMIN."/inc/inc_catalog_options.php");
require_once(DEDEINC."/dedetag.class.php");
if ($dopost != 'save') {
require_once(DEDEADMIN . "/inc/inc_catalog_options.php");
require_once(DEDEINC . "/dedetag.class.php");
ClearMyAddon();
$aid = intval($aid);
@@ -28,16 +28,14 @@ if($dopost!='save')
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);
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'];
@@ -53,116 +51,104 @@ if($dopost!='save')
$ddmaxwidth = $addRow["ddmaxwidth"];
$pagepicnum = $addRow["pagepicnum"];
$tags = GetTags($aid);
$arcRow=XSSClean($arcRow);$addRow=XSSClean($addRow);
$arcRow = XSSClean($arcRow);
$addRow = XSSClean($addRow);
include DedeInclude("templets/album_edit.htm");
exit();
}
/*--------------------------------
function __save(){ }
-------------------------------*/
else if($dopost=='save')
{
require_once(DEDEINC.'/image.func.php');
require_once(DEDEINC.'/oxwindow.class.php');
-------------------------------*/ 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(!isset($formhtml)) $formhtml = 0;
if(!isset($albums)) $albums = "";
if(!isset($formzip)) $formzip = 0;
if(!isset($ddisfirst)) $ddisfirst = 0;
if(!isset($delzip)) $delzip = 0;
$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 (!isset($formhtml)) $formhtml = 0;
if (!isset($albums)) $albums = "";
if (!isset($formzip)) $formzip = 0;
if (!isset($ddisfirst)) $ddisfirst = 0;
if (!isset($delzip)) $delzip = 0;
if($typeid==0)
{
ShowMsg("请指定文档的栏目!","-1");
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;
$title = 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));
$sortrank = AddDay($pubdate, $sortup);
$ismake = $ishtml == 0 ? -1 : 0;
$title = 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);
// 处理新的缩略图上传
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;
}
//分析body里的内容
$body = AnalyseHtmlBody($body, $description, $litpic, $keywords, 'htmltext');
//处理图片文档的自定义属性
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
@@ -188,9 +174,8 @@ else if($dopost=='save')
dutyadmin='$adminid'
WHERE id='$id'; ";
if(!$dsql->ExecuteNoneQuery($query))
{
ShowMsg("更新数据库archives表时出错,请检查!".$dsql->GetError(),"javascript:;");
if (!$dsql->ExecuteNoneQuery($query)) {
ShowMsg("更新数据库archives表时出错,请检查!" . $dsql->GetError(), "javascript:;");
exit();
}
@@ -200,67 +185,57 @@ else if($dopost=='save')
//----------------------------------------
//检查旧的图片是否有更新,并保存
//-----------------------------------------
for($i=1; $i<=120; $i++)
{
if( !isset(${'imgurl'.$i}) ) continue;
for ($i = 1; $i <= 120; $i++) {
if (!isset(${'imgurl' . $i})) continue;
$info = '';
$iinfo = str_replace("'", "`", stripslashes(${'imgmsg'.$i}));
$iurl = stripslashes(${'imgurl'.$i});
$ddurl = stripslashes(${'imgddurl'.$i});
if(preg_match("#swfupload#i", $ddurl)) $ddurl = '';
$imgfile = $cfg_basedir.$iurl;
$litimgfile = $cfg_basedir.$ddurl;
$iinfo = str_replace("'", "`", stripslashes(${'imgmsg' . $i}));
$iurl = stripslashes(${'imgurl' . $i});
$ddurl = stripslashes(${'imgddurl' . $i});
if (preg_match("#swfupload#i", $ddurl)) $ddurl = '';
$imgfile = $cfg_basedir . $iurl;
$litimgfile = $cfg_basedir . $ddurl;
//有上传文件的情况
if( isset(${'imgfile'.$i}) && is_uploaded_file(${'imgfile'.$i}) )
{
$tmpFile = ${'imgfile'.$i};
if (isset(${'imgfile' . $i}) && is_uploaded_file(${'imgfile' . $i})) {
$tmpFile = ${'imgfile' . $i};
//检测上传的图片, 如果类型不对,保留原来图片
$imginfos = @GetImageSize($tmpFile, $info);
if(!is_array($imginfos))
{
if (!is_array($imginfos)) {
$imginfos = @GetImageSize($imgfile, $info);
$imgurls .= "{dede:img ddimg='$ddurl' text='$iinfo' width='".$imginfos[0]."' height='".$imginfos[1]."'} $iurl {/dede:img}\r\n";
$imgurls .= "{dede:img ddimg='$ddurl' text='$iinfo' width='" . $imginfos[0] . "' height='" . $imginfos[1] . "'} $iurl {/dede:img}\r\n";
continue;
}
move_uploaded_file($tmpFile, $imgfile);
$imginfos = @GetImageSize($imgfile, $info);
if($ddurl==$iurl)
{
if ($ddurl == $iurl) {
$litpicname = $pagestyle > 2 ? GetImageMapDD($iurl, $cfg_ddimg_width) : $iurl;
$litimgfile = $cfg_basedir.$litpicname;
}
else
{
if($cfg_ddimg_full=='Y') ImageResizeNew($imgfile, $cfg_ddimg_width, $cfg_ddimg_height, $litimgfile);
$litimgfile = $cfg_basedir . $litpicname;
} else {
if ($cfg_ddimg_full == 'Y') ImageResizeNew($imgfile, $cfg_ddimg_width, $cfg_ddimg_height, $litimgfile);
else ImageResize($imgfile, $cfg_ddimg_width, $cfg_ddimg_height, $litimgfile);
$litpicname = $ddurl;
}
$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信息)
else
{
$iinfo = str_replace("'", "`", stripslashes(${'imgmsg'.$i}));
$iurl = stripslashes(${'imgurl'.$i});
$ddurl = stripslashes(${'imgddurl'.$i});
if(preg_match("#swfupload#i", $ddurl))
{
else {
$iinfo = str_replace("'", "`", stripslashes(${'imgmsg' . $i}));
$iurl = stripslashes(${'imgurl' . $i});
$ddurl = stripslashes(${'imgddurl' . $i});
if (preg_match("#swfupload#i", $ddurl)) {
$ddurl = $pagestyle > 2 ? GetImageMapDD($iurl, $cfg_ddimg_width) : $iurl;
}
$imginfos = @GetImageSize($imgfile, $info);
$imgurls .= "{dede:img ddimg='$ddurl' text='$iinfo' width='".$imginfos[0]."' height='".$imginfos[1]."'} $iurl {/dede:img}\r\n";
$imgurls .= "{dede:img ddimg='$ddurl' text='$iinfo' width='" . $imginfos[0] . "' height='" . $imginfos[1] . "'} $iurl {/dede:img}\r\n";
}
}
//----------------------------
//从HTML中获取新图片
//----------------------------
if($formhtml==1 && !empty($imagebody))
{
if ($formhtml == 1 && !empty($imagebody)) {
$imagebody = stripslashes($imagebody);
$imgurls .= GetCurContentAlbum($imagebody,$copysource,$litpicname);
if($ddisfirst==1 && $litpic=="" && !empty($litpicname))
{
$imgurls .= GetCurContentAlbum($imagebody, $copysource, $litpicname);
if ($ddisfirst == 1 && $litpic == "" && !empty($litpicname)) {
$litpic = $litpicname;
$hasone = true;
}
@@ -269,60 +244,55 @@ else if($dopost=='save')
function _getformzip()
从ZIP文件中获取新图片
---------------------*/
if($formzip==1)
{
include_once(DEDEINC."/zip.class.php");
include_once(DEDEADMIN."/file_class.php");
$zipfile = $cfg_basedir.str_replace($cfg_mainsite,'',$zipfile);
$tmpzipdir = DEDEDATA.'/ziptmp/'.cn_substr(md5(ExecTime()),16);
if ($formzip == 1) {
include_once(DEDEINC . "/zip.class.php");
include_once(DEDEADMIN . "/file_class.php");
$zipfile = $cfg_basedir . str_replace($cfg_mainsite, '', $zipfile);
$tmpzipdir = DEDEDATA . '/ziptmp/' . cn_substr(md5(ExecTime()), 16);
$ntime = time();
if(file_exists($zipfile))
{
if (file_exists($zipfile)) {
@mkdir($tmpzipdir,$GLOBALS['cfg_dir_purview']);
@chmod($tmpzipdir,$GLOBALS['cfg_dir_purview']);
@mkdir($tmpzipdir, $GLOBALS['cfg_dir_purview']);
@chmod($tmpzipdir, $GLOBALS['cfg_dir_purview']);
$z = new zip();
$z->ExtractAll($zipfile,$tmpzipdir);
$z->ExtractAll($zipfile, $tmpzipdir);
$fm = new FileManagement();
$imgs = array();
$fm->GetMatchFiles($tmpzipdir,"jpg|png|gif",$imgs);
$fm->GetMatchFiles($tmpzipdir, "jpg|png|gif", $imgs);
$i = 0;
foreach($imgs as $imgold)
{
foreach ($imgs as $imgold) {
$i++;
$savepath = $cfg_image_dir."/".MyDate("Y-m",$ntime);
$savepath = $cfg_image_dir . "/" . MyDate("Y-m", $ntime);
CreateDir($savepath);
$iurl = $savepath."/".MyDate("d",$ntime).dd2char(MyDate("His",$ntime).'-'.$adminid."-{$i}".mt_rand(1000,9999));
$iurl = $iurl.substr($imgold,-4,4);
$imgfile = $cfg_basedir.$iurl;
copy($imgold,$imgfile);
$iurl = $savepath . "/" . MyDate("d", $ntime) . dd2char(MyDate("His", $ntime) . '-' . $adminid . "-{$i}" . mt_rand(1000, 9999));
$iurl = $iurl . substr($imgold, -4, 4);
$imgfile = $cfg_basedir . $iurl;
copy($imgold, $imgfile);
unlink($imgold);
if(is_file($imgfile))
{
$litpicname = $pagestyle > 2 ? GetImageMapDD($iurl,$cfg_ddimg_width) : $iurl;
if (is_file($imgfile)) {
$litpicname = $pagestyle > 2 ? GetImageMapDD($iurl, $cfg_ddimg_width) : $iurl;
$info = '';
$imginfos = GetImageSize($imgfile,$info);
$imgurls .= "{dede:img ddimg='$litpicname' text='' width='".$imginfos[0]."' height='".$imginfos[1]."'} $iurl {/dede:img}\r\n";
$imginfos = GetImageSize($imgfile, $info);
$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');
VALUES ('{$title}','{$iurl}','1','" . $imginfos[0] . "','" . $imginfos[1] . "','0','" . filesize($imgfile) . "','" . $ntime . "','$adminid');
";
$dsql->ExecuteNoneQuery($inquery);
if(!$hasone && $ddisfirst==1
&& $litpic=="" && !empty($litpicname))
{
if( file_exists($cfg_basedir.$litpicname) )
{
if (
!$hasone && $ddisfirst == 1
&& $litpic == "" && !empty($litpicname)
) {
if (file_exists($cfg_basedir . $litpicname)) {
$litpic = $litpicname;
$hasone = true;
}
}
}
}
if($delzip==1)
{
if ($delzip == 1) {
unlink($zipfile);
}
$fm->RmDirFiles($tmpzipdir);
@@ -330,59 +300,53 @@ else if($dopost=='save')
}
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];
$data = explode( ',', $album['img'] );
$data = explode(',', $album['img']);
$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]));
$info = '';
$imginfos = GetImageSize($cfg_basedir.$fullUrl, $info);
$imginfos = GetImageSize($cfg_basedir . $fullUrl, $info);
$v = $fullUrl;
$imginfo = !empty($album['txt']) ? $album['txt'] : '';
$imgurls .= "{dede:img ddimg='$v' text='$imginfo' width='".$imginfos[0]."' height='".$imginfos[1]."'} $v {/dede:img}\r\n";
$imgurls .= "{dede:img ddimg='$v' text='$imginfo' width='" . $imginfos[0] . "' height='" . $imginfos[1] . "'} $v {/dede:img}\r\n";
}
}
$imgurls = addslashes($imgurls);
//分析处理附加表数据
$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 = 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]} . "'";
}
}
}
@@ -390,8 +354,7 @@ else if($dopost=='save')
//更新附加表
$cts = $dsql->GetOne("SELECT addtable FROM `#@__channeltype` WHERE id='$channelid' ");
$addtable = trim($cts['addtable']);
if($addtable!='')
{
if ($addtable != '') {
$useip = GetIP();
$query = "Update `$addtable`
set typeid='$typeid',
@@ -407,39 +370,36 @@ else if($dopost=='save')
redirecturl='$redirecturl',
userip = '$useip'
WHERE aid='$id'; ";
if(!$dsql->ExecuteNoneQuery($query))
{
ShowMsg("更新附加表 `$addtable` 时出错,请检查原因!".$dsql->GetError(),"javascript:;");
if (!$dsql->ExecuteNoneQuery($query)) {
ShowMsg("更新附加表 `$addtable` 时出错,请检查原因!" . $dsql->GetError(), "javascript:;");
exit();
}
}
//生成HTML
UpIndexKey($id,$arcrank,$typeid,$sortrank,$tags);
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');
}else{
$config=array();
UpIndexKey($id, $arcrank, $typeid, $sortrank, $tags);
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');
} else {
$config = array();
}
if(!$ftp->connect($config)) exit('Error:None FTP Connection!');
if (!$ftp->connect($config)) exit('Error:None FTP Connection!');
}
$arcUrl = MakeArt($id,true,true,$isremote);
if($arcUrl=='')
{
$arcUrl = $cfg_phpurl."/view.php?aid=$id";
$arcUrl = MakeArt($id, true, true, $isremote);
if ($arcUrl == '') {
$arcUrl = $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);
}
}
}
@@ -447,10 +407,10 @@ else if($dopost=='save')
//返回成功信息
$msg =
"   请选择你的后续操作:
"   请选择你的后续操作:
<a href='album_add.php?cid=$typeid' class='btn btn-secondary btn-sm'>继续发布图片</a>
&nbsp;&nbsp;
<a href='archives_do.php?aid=".$id."&dopost=editArchives' class='btn btn-secondary btn-sm'>查看更改</a>
<a href='archives_do.php?aid=" . $id . "&dopost=editArchives' class='btn btn-secondary btn-sm'>查看更改</a>
&nbsp;&nbsp;
<a href='$arcUrl' target='_blank' class='btn btn-secondary btn-sm'>预览文档</a>
&nbsp;&nbsp;
@@ -464,6 +424,6 @@ else if($dopost=='save')
$win = new OxWindow();
$win->AddTitle("成功更改一个图集:");
$win->AddMsgItem($msg);
$winform = $win->GetWindow("hand","&nbsp;",false);
$winform = $win->GetWindow("hand", "&nbsp;", false);
$win->Display();
}
}

+ 4
- 3
src/dede/album_testhtml.php View File

@@ -1,15 +1,16 @@
<?php
/**
* 图集测试
*
* @version $Id: album_testhtml.php 1 8:26 2010年7月12日Z tianya $
* @package DedeCMS.Administrator
* @package DedeBIZ.Administrator
* @copyright Copyright (c) 2020, 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");
AjaxHead();
$myhtml = UnicodeUrl2Gbk(stripslashes($myhtml));
echo "<div class='coolbg61'>[<a href='#' onclick='javascript:HideObj(\"_myhtml\")'>关闭</a>]</div>\r\n";
@@ -18,4 +19,4 @@ $img_array = array_unique($img_array[2]);
echo "<div class='coolbg62'><xmp>";
echo "捕获的图片:\r\n";
print_r($img_array);
echo "</xmp></div>\r\n";
echo "</xmp></div>\r\n";

+ 93
- 118
src/dede/archives_add.php View File

@@ -1,38 +1,34 @@
<?php
/**
* 文档发布
*
* @version $Id: archives_add.php 1 8:26 2010年7月12日Z tianya $
* @package DedeCMS.Administrator
* @package DedeBIZ.Administrator
* @copyright Copyright (c) 2020, 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');
CheckPurview('a_New,a_AccNew');
require_once(DEDEINC.'/customfields.func.php');
require_once(DEDEADMIN.'/inc/inc_archives_functions.php');
require_once(DEDEINC . '/customfields.func.php');
require_once(DEDEADMIN . '/inc/inc_archives_functions.php');
if(empty($dopost)) $dopost = '';
if (empty($dopost)) $dopost = '';
if($dopost != 'save')
{
require_once(DEDEINC.'/dedetag.class.php');
require_once(DEDEADMIN.'/inc/inc_catalog_options.php');
if ($dopost != 'save') {
require_once(DEDEINC . '/dedetag.class.php');
require_once(DEDEADMIN . '/inc/inc_catalog_options.php');
ClearMyAddon();
$channelid = empty($channelid) ? 0 : intval($channelid);
$cid = empty($cid) ? 0 : intval($cid);
//获得频道模型ID
if($cid > 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)
{
} else {
if ($channelid == 0) {
ShowMsg('无法识别模型信息,因此无法操作!', '-1');
exit();
}
@@ -48,188 +44,167 @@ 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($click)) $click = ($cfg_arc_click=='-1' ? mt_rand(50, 200) : $cfg_arc_click);
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(empty($click)) $click = ($cfg_arc_click=='-1' ? mt_rand(50, 200) : $cfg_arc_click);
if($typeid==0)
{
-------------------------------*/ 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($click)) $click = ($cfg_arc_click == '-1' ? mt_rand(50, 200) : $cfg_arc_click);
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 (empty($click)) $click = ($cfg_arc_click == '-1' ? mt_rand(50, 200) : $cfg_arc_click);
if ($typeid == 0) {
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_New'))
{
if (!TestPurview('a_New')) {
CheckCatalog($typeid, "对不起,你没有操作栏目 {$typeid} 的权限!");
}