From 172d9bc2d5b982b82ada1420c926c0164da36ac4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8F=99=E8=BF=B0=E3=80=81=E5=88=AB=E7=A6=BB?= <93301500+xushubieli@users.noreply.github.com> Date: Thu, 16 Mar 2023 09:55:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=BC=E5=AE=B9=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/admin/inc/inc_batchup.php | 2 +- src/admin/index_body.php | 4 +- src/admin/sys_data.php | 2 +- src/admin/sys_data_done.php | 71 ++++++++++++------------ src/admin/sys_data_replace.php | 2 +- src/admin/templets/index_body.htm | 28 ++++++---- src/admin/templets/makehtml_homepage.htm | 8 +-- src/admin/templets/sys_safetest.htm | 4 +- src/system/archive/archives.class.php | 11 ++-- src/system/common.func.php | 71 ++++++++++++------------ src/system/common.inc.php | 2 +- src/theme/dedebiz/index.htm | 21 ++++--- src/user/templets/album_add.htm | 2 +- src/user/templets/album_edit.htm | 2 +- src/user/templets/archives_add.htm | 2 +- src/user/templets/archives_edit.htm | 2 +- src/user/templets/archives_sg_add.htm | 2 +- src/user/templets/archives_sg_edit.htm | 2 +- src/user/templets/article_add.htm | 2 +- src/user/templets/article_edit.htm | 2 +- src/user/templets/buy.htm | 20 +++---- src/user/templets/buy_action_payment.htm | 2 +- src/user/templets/content_list.htm | 2 +- src/user/templets/content_sg_list.htm | 2 +- src/user/templets/menu.htm | 6 +- src/user/templets/pm-main.htm | 2 +- src/user/templets/soft_add.htm | 2 +- src/user/templets/soft_edit.htm | 2 +- 28 files changed, 139 insertions(+), 141 deletions(-) diff --git a/src/admin/inc/inc_batchup.php b/src/admin/inc/inc_batchup.php index 126de64c..66d227ec 100644 --- a/src/admin/inc/inc_batchup.php +++ b/src/admin/inc/inc_batchup.php @@ -54,7 +54,7 @@ function DelArc($aid, $type = 'ON', $onlyfile = FALSE, $recycle = 0) return FALSE; } } - //$issystem==-1 是自定义模型,不使用回收站 + //$issystem==-1是自定义模型,不使用回收站 if ($issystem == -1) $type = 'OK'; if (!is_array($arcRow)) return FALSE; /** 删除到回收站 **/ diff --git a/src/admin/index_body.php b/src/admin/index_body.php index f753bd39..ae2264cd 100644 --- a/src/admin/index_body.php +++ b/src/admin/index_body.php @@ -40,7 +40,7 @@ else if ($dopost == 'setskin') { $admin_catalog = join(',', $admin_catalogs); $userCatalogSql = "AND arc.typeid IN($admin_catalog) "; } - $query = "SELECT arc.id, arc.arcrank, arc.title, arc.typeid, arc.mid, arc.pubdate, arc.channel, ch.editcon, tp.typename FROM `#@__archives` arc LEFT JOIN `#@__channeltype` ch ON ch.id = arc.channel LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id WHERE arc.arcrank<>-2 {$userCatalogSql} AND arc.mid={$cuserLogin->getUserID()} ORDER BY arc.id DESC LIMIT 0,12"; + $query = "SELECT arc.id, arc.arcrank, arc.title, arc.typeid, arc.mid, arc.pubdate, arc.channel, ch.editcon, tp.typename FROM `#@__archives` arc LEFT JOIN `#@__channeltype` ch ON ch.id = arc.channel LEFT JOIN `#@__arctype` tp ON arc.typeid=tp.id WHERE arc.arcrank<>-2 {$userCatalogSql} AND arc.mid={$cuserLogin->getUserID()} ORDER BY arc.id DESC LIMIT 0,15"; $arcArr = array(); $dsql->Execute('m', $query); while($row = $dsql->GetArray('m')) @@ -55,7 +55,7 @@ else if ($dopost == 'setskin') { if (trim($row['editcon'])=='') { $row['editcon'] = 'archives_edit.php'; } - $rowarcrank = $row['arcrank']==-1? " 未审核":""; + $rowarcrank = $row['arcrank']==-1? "未审核":""; $pubdate = GetDateMk($row['pubdate']); echo "{$row['title']}{$rowarcrank}{$pubdate}"; } diff --git a/src/admin/sys_data.php b/src/admin/sys_data.php index ff758fd2..b1f30a20 100644 --- a/src/admin/sys_data.php +++ b/src/admin/sys_data.php @@ -1,6 +1,6 @@ $gotojs"; //备份数据 if ($dopost == 'bak') { if (empty($tablearr)) { - ShowMsg('您没选中数据表', 'javascript:;'); + ShowMsg('您还没选择备份数据表', 'javascript:;'); exit(); } if (!is_dir($bkdir)) { @@ -63,7 +63,7 @@ if ($dopost == 'bak') { } } $dh->close(); - $tmsg .= "清除备份目录旧数据完成"; + $tmsg .= "完成备份目录旧数据清理"; if ($isstruct == 1) { $bkfile = $bkdir."/tables_struct_".substr(md5(time().mt_rand(1000, 5000).$cfg_cookie_encode), 0, 16).".txt"; $mysql_version = $dsql->GetVersion(); @@ -80,17 +80,17 @@ if ($dopost == 'bak') { fwrite($fp, ''.$tableStruct.";\r\n\r\n"); } fclose($fp); - $tmsg .= "备份数据表结构信息完成"; + $tmsg .= "完成备份数据表结构信息"; } $tmsg .= "正在进行数据备份初始化工作,请稍后"; $doneForm = "
- - - - - - - \r\n
\r\n{$dojs}\r\n"; + + + + + + + \r\n\r\n{$dojs}\r\n"; PutInfo($tmsg, $doneForm); exit(); } @@ -104,7 +104,6 @@ if ($dopost == 'bak') { $dsql->GetTableFields($nowtable); $intable = "INSERT INTO `$nowtable` VALUES("; while ($r = $dsql->GetFieldObject()) { - $fs[$j] = trim($r->name); $j++; } @@ -124,15 +123,15 @@ if ($dopost == 'bak') { $fp = fopen($bakfilename, "w"); fwrite($fp, $bakStr); fclose($fp); - $tmsg = "完成到{$m}条数据备份,继续备份{$nowtable}"; + $tmsg = "正在备份{$m}条数据,继续备份{$nowtable}"; $doneForm = "
- - - - - - - \r\n
\r\n{$dojs}\r\n"; + + + + + + + \r\n\r\n{$dojs}\r\n"; PutInfo($tmsg, $doneForm); exit(); } @@ -161,17 +160,17 @@ if ($dopost == 'bak') { $startpos = 0; break; } else { - PutInfo("完成所有数据备份", ""); + PutInfo("成功完成所有数据备份", ""); exit(); } } } - $tmsg = "完成到{$m}条数据备份,继续备份{$nowtable}"; + $tmsg = "正在备份{$m}条数据,继续备份{$nowtable}"; $doneForm = "
- - - - + + + + \r\n
\r\n{$dojs}\r\n"; PutInfo($tmsg, $doneForm); exit(); @@ -181,7 +180,7 @@ if ($dopost == 'bak') { //还原数据 else if ($dopost == 'redat') { if ($bakfiles == '') { - ShowMsg('没指定任何要还原数据', 'javascript:;'); + ShowMsg('您还没选择还原数据表', 'javascript:;'); exit(); } $bakfilesTmp = $bakfiles; @@ -210,11 +209,11 @@ else if ($dopost == 'redat') { if ($delfile == 1) { @unlink("$bkdir/$structfile"); } - $tmsg = "完成数据表还原,继续还原数据"; + $tmsg = "成功完成数据表还原,继续还原其它数据"; $doneForm = "
- - - + + +
\r\n{$dojs}\r\n"; PutInfo($tmsg, $doneForm); exit(); @@ -236,14 +235,14 @@ else if ($dopost == 'redat') { @unlink("$bkdir/$nowfile"); } if ($bakfilesTmp == "") { - ShowMsg('成功还原所有的文件数据', 'javascript:;'); + ShowMsg('成功还原所有数据', 'javascript:;'); exit(); } - $tmsg = "成功还原{$nowfile}文件{$oknum}条数据,正在继续还原其它数据"; + $tmsg = "正在还原$nowfile}文件{$oknum}条数据,继续还原其它数据"; $doneForm = "
- - - + + +
\r\n{$dojs}\r\n"; PutInfo($tmsg, $doneForm); exit(); diff --git a/src/admin/sys_data_replace.php b/src/admin/sys_data_replace.php index 6b3aae3d..16adff58 100644 --- a/src/admin/sys_data_replace.php +++ b/src/admin/sys_data_replace.php @@ -1,6 +1,6 @@ -
+
软件信息 - 软件:|操作系统:|Web服务器:|PHP:|数据库:GetVersion();?> + 软件:丨操作系统:丨Web服务器:丨PHP:丨数据库:GetVersion();?>丨上传限制:
- - - - - +
+

操作系统

+

WEB服务器

+

IP地址

+

PHP版本

+

数据库版本

GetVersion();?>
+
+

上传限制

+ +
+
-
+
版本授权 @@ -112,17 +118,17 @@
正在加载
-
+
-
+
最新文档 diff --git a/src/admin/templets/makehtml_homepage.htm b/src/admin/templets/makehtml_homepage.htm index 9db2029a..dcc95dc4 100644 --- a/src/admin/templets/makehtml_homepage.htm +++ b/src/admin/templets/makehtml_homepage.htm @@ -61,7 +61,7 @@ if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { $client = new DedeBizClient(); $data = $client->AdminPWDExists(); - if ($data->code == -1){ + if ($data->code == -1) { ?> 启动商业组件失败,如何启动组件 @@ -92,11 +92,7 @@ - + 启动商业组件失败启动组件 diff --git a/src/admin/templets/sys_safetest.htm b/src/admin/templets/sys_safetest.htm index 211d99e6..bf9056f2 100644 --- a/src/admin/templets/sys_safetest.htm +++ b/src/admin/templets/sys_safetest.htm @@ -51,13 +51,13 @@ -
+ +
  • 检测结果:结果仅供参考,请务必查看源码后才删除非法文件
  • 安全建议:1、有条件的会员把data、system、theme修改为不可对外浏览,static、a目录设置为不允许执行脚本,其它目录禁止写入,系统更安全;2、本检测程以开发模式为标准,如果您的网站目录包含其它系统,此检测程序可能会产生错误判断;3、检测程序会跳过对模板缓存目录的检测,为了安全起见,检测完成后建议清空模板缓存
- diff --git a/src/system/archive/archives.class.php b/src/system/archive/archives.class.php index 76930158..3180a89b 100755 --- a/src/system/archive/archives.class.php +++ b/src/system/archive/archives.class.php @@ -96,17 +96,16 @@ class Archives foreach ($GLOBALS['PubFields'] as $k => $v) { $this->Fields[$k] = $v; } - //为了减少重复查询,这里直接把附加表查询记录放在 $this->addTableRow 中,在 ParAddTable() 不再查询 + //为了减少重复查询,这里直接把附加表查询记录放在$this->addTableRow中,在ParAddTable()不再查询 if ($this->ChannelUnit->ChannelInfos['addtable'] != '') { if ($this->ChannelUnit->ChannelID < 0) { $query = "SELECT tb.*,mb.uname,mb.face FROM `{$this->ChannelUnit->ChannelInfos['addtable']}` tb LEFT JOIN `#@__member` mb on tb.mid = mb.mid WHERE tb.`aid` = '$aid'"; } else { $query = "SELECT * FROM `{$this->ChannelUnit->ChannelInfos['addtable']}` WHERE `aid` = '$aid'"; } - $this->addTableRow = $this->dsql->GetOne($query); } - //issystem==-1 表示自定义模型,自定义模型不支持redirecturl这类参数,因此限定文档普通模型才进行下面查询 + //issystem==-1表示自定义模型,自定义模型不支持redirecturl这类参数,因此限定文档普通模型才进行下面查询 if ($this->ChannelUnit->ChannelInfos['addtable'] != '' && $this->ChannelUnit->ChannelInfos['issystem'] != -1) { if (is_array($this->addTableRow)) { $this->Fields['redirecturl'] = $this->addTableRow['redirecturl']; @@ -189,15 +188,15 @@ class Archives //设置全局环境变量 $this->Fields['typename'] = $this->TypeLink->TypeInfos['typename']; @SetSysEnv($this->Fields['typeid'], $this->Fields['typename'], $this->Fields['id'], $this->Fields['title'], 'archives'); - //文档图片注释替换为标题,利于优化 + //文档模型正文图片注释自动为标题 $this->Fields['body'] = str_ireplace(array('alt=""','alt=\'\''),'',$this->Fields['body']); $this->Fields['body'] = preg_replace("@ [\s]{0,}alt[\s]{0,}=[\"'\s]{0,}[\s\S]{0,}[\"'\s] @isU","",$this->Fields['body']); $this->Fields['body'] = str_ireplace("Fields['title']."\" title=\"".$this->Fields['title']."\" ",$this->Fields['body']); - //图片注释替换为标题,利于优化 + //图片模型正文图片注释自动为标题 $this->Fields['imgurls'] = str_ireplace(array('alt=""','alt=\'\''),'',$this->Fields['imgurls']); $this->Fields['imgurls'] = preg_replace("@ [\s]{0,}alt[\s]{0,}=[\"'\s]{0,}[\s\S]{0,}[\"'\s] @isU","",$this->Fields['imgurls']); $this->Fields['imgurls'] = str_ireplace("Fields['title']."\" title=\"".$this->Fields['title']."\"",$this->Fields['imgurls']); - //清除文档图片的宽度和高度,适配自适应网站 + //移除文档模型正文图片宽度和高度,适配自适应/响应式网站 $this->Fields['body'] = preg_replace("/style=\"width\:(.*)\"/","",$this->Fields['body']); } //完成附加表信息读取 diff --git a/src/system/common.func.php b/src/system/common.func.php index dfe620f1..cdf09ab4 100755 --- a/src/system/common.func.php +++ b/src/system/common.func.php @@ -9,7 +9,7 @@ if (!defined('DEDEINC')) exit('dedebiz'); * @license https://www.dedebiz.com/license * @link https://www.dedebiz.com */ -//显示类似Bootstrap警告框 +//类似Bootstrap警告框 define('ALERT_PRIMARY', 1); define('ALERT_SECONDARY', 2); define('ALERT_SUCCESS', 3); @@ -28,7 +28,7 @@ define('ALERT_COLORS', array( ALERT_LIGHT => array('#fefefe','#fdfdfe','#636464'), ALERT_DARK => array('#d3d3d4','#bcbebf','#141619'), )); -define("ALERT_TPL", '
~content~
'); +define("ALERT_TPL", '
~content~
'); //$content:文档,$type:alert类型 function DedeAlert($content, $type = ALERT_PRIMARY, $isHTML=false) { @@ -188,12 +188,12 @@ if (!function_exists('CheckSql')) { if (preg_match("#^create table#i", $clean)) $fail = FALSE; $error = "unusual character"; } - //老版本的Mysql并不支持union,常用的程序里也不使用union,但是一些黑客使用它,所以检查它 + //老版本数据库不支持union,程序不使用union,但黑客使用它,所以检查它 if (strpos($clean, 'union') !== FALSE && preg_match('~(^|[^a-z])union($|[^[a-z])~s', $clean) != 0) { $fail = TRUE; $error = "union detect"; } - //发布版本的程序可能比较少包括--,#这样的注释,但是黑客经常使用它们 + //发布版本的程序可能比较少包括--,#这样的注释,但黑客经常使用它们 elseif (strpos($clean, '/*') > 2 || strpos($clean, '--') !== FALSE || strpos($clean, '#') !== FALSE) { $fail = TRUE; $error = "comment detect"; @@ -212,7 +212,7 @@ if (!function_exists('CheckSql')) { $fail = TRUE; $error = "file fun detect"; } - //老版本的MYSQL不支持子查询,我们的程序里可能也用得少,但是黑客可以使用它来查询数据库敏感信息 + //老版本数据库不支持子查询,该功能也用得少,但黑客可以使用它来查询数据库敏感信息 elseif (preg_match('~\([^)]*?select~s', $clean) != 0) { $fail = TRUE; $error = "sub select detect"; @@ -226,8 +226,7 @@ if (!function_exists('CheckSql')) { } } /** - * 载入小助手,系统默认载入小助手 - * 在/data/helper.inc.php中进行默认小助手初始化的设置,创建一个示例为test.helper.php文件基本文档如下: + * 载入小助手,系统默认载入小助手示例: * * if (!function_exists('HelloDede')) * { @@ -237,10 +236,10 @@ if (!function_exists('CheckSql')) { * } * } * - * 则我们在开发中使用这个小助手的时候直接使用函数helper('test');初始化它,然后在文件中就可以直接使用:HelloDede();来进行调用 + * 开发中使用这个小助手的时候直接使用函数helper('test');初始化它,然后在文件中就可以直接使用:HelloDede();调用 * * @access public - * @param mix $helpers 小助手名称,可以是数组,可以是单个字符串 + * @param mix $helpers 小助手名称,可以是数组,可以是单个字符串 * @return void */ $_helpers = array(); @@ -426,6 +425,20 @@ function IndexSub($idx, $num) { return intval($idx) - intval($num) == 0 ? '0 ' : intval($idx) - intval($num); } +/** + * HideEmail隐藏邮箱 + * + * @param mixed $email + * @return string + */ +function HideEmail($email) +{ + if (empty($email)) return "暂无"; + $em = explode("@",$email); + $name = implode('@', array_slice($em, 0, count($em)-1)); + $len = floor(strlen($name)/2); + return substr($name,0, $len).str_repeat('*', $len)."@".end($em); +} //用来返回index的active function IndexActive($idx) { @@ -508,7 +521,18 @@ function GetUpdateSQL() fclose($fp); return $result; } -//标签调用标签[field:id function='GetMyTags(@me,2)'/]2表示输出2个文档 +/*会员中心调用默认主题模板*/ +if (!function_exists('pasterTempletDiy')) { + function pasterTempletDiy($path) + { + global $cfg_basedir, $cfg_templets_dir, $cfg_df_style; + $tmpfile = $cfg_basedir.$cfg_templets_dir.'/'.$cfg_df_style.'/'.$path; + $dtp = new PartView(); + $dtp->SetTemplet($tmpfile); + $dtp->Display(); + } +} +//标签调用标签[field:id function='GetMyTags(@me,2)'/]2表示调用文档2个标签 if (!function_exists('GetMyTags')) { function GetMyTags($aid, $num=3) { @@ -523,18 +547,7 @@ if (!function_exists('GetMyTags')) { return $tags; } } -/*会员中心调用默认模板*/ -if (!function_exists('pasterTempletDiy')) { - function pasterTempletDiy($path) - { - global $cfg_basedir, $cfg_templets_dir, $cfg_df_style; - $tmpfile = $cfg_basedir.$cfg_templets_dir.'/'.$cfg_df_style.'/'.$path; - $dtp = new PartView(); - $dtp->SetTemplet($tmpfile); - $dtp->Display(); - } -} -//联动单筛选标签{dede:php}AddFilter(模型id,类型,'字段1,字段2');{/dede:php} +//联动单筛选标签{dede:php}AddFilter(模型id,类型,'字段1,字段2');{/dede:php}类型对应以下case数值 function litimgurls($imgid = 0) { global $lit_imglist, $dsql; @@ -630,20 +643,6 @@ function AddFilter($channelid, $type=1, $fieldsnamef='', $defaulttid=0, $toptid= } echo $dede_addonfields; } -/** - * HideEmail隐藏邮箱 - * - * @param mixed $email - * @return string - */ -function HideEmail($email) -{ - if (empty($email)) return "空"; - $em = explode("@",$email); - $name = implode('@', array_slice($em, 0, count($em)-1)); - $len = floor(strlen($name)/2); - return substr($name,0, $len).str_repeat('*', $len)."@".end($em); -} //自定义函数接口 if (file_exists(DEDEINC.'/extend.func.php')) { require_once(DEDEINC.'/extend.func.php'); diff --git a/src/system/common.inc.php b/src/system/common.inc.php index 8cfaf303..1f0832a3 100755 --- a/src/system/common.inc.php +++ b/src/system/common.inc.php @@ -260,7 +260,7 @@ if ($GLOBALS['cfg_dbtype'] == 'mysql' || $GLOBALS['cfg_dbtype'] == 'mysqli') { } else { require_once(DEDEINC.'/database/dedesqlite.class.php'); } -//载入小助手配置,并对其进行默认初始化 +//载入小助手配置,并对其进行默认初始化 $cfg_helper_autoload = array( 'charset', /* 编码小助手 */ 'channelunit',/* 模型单元小助手 */ diff --git a/src/theme/dedebiz/index.htm b/src/theme/dedebiz/index.htm index b5dbd59d..6868b927 100644 --- a/src/theme/dedebiz/index.htm +++ b/src/theme/dedebiz/index.htm @@ -42,12 +42,12 @@
-
{dede:channelartlist typeid='1,1'} +
{dede:channelartlist typeid='18,18'}

{dede:field.typename/}

-
{dede:arclist row='3' orderby='id'} +
{dede:arclist row='3' orderby='rand'}
[field:array runphp='yes']@me=(strpos(@me['litpic'],'thumbnail')?"":"{@me[");[/field:array]
@@ -69,12 +69,12 @@
-
{dede:channelartlist typeid='2,2'} +
{dede:channelartlist typeid='17,17'}

{dede:field.typename/}

-
{dede:arclist row='3' orderby='id'} +
{dede:arclist row='3' orderby='rand'}
[field:array runphp='yes']@me=(strpos(@me['litpic'],'thumbnail')?"":"{@me[");[/field:array]
@@ -91,28 +91,27 @@
-
- {dede:channelartlist typeid='3,3'} +
{dede:channelartlist typeid='18,18'}

{dede:field.typename/}

-
    {dede:arclist row='10' titlelen='120' orderby='id'} +
      {dede:arclist row='10' titlelen='120' orderby='rand'}
    • [field:global.autoindex/].[field:title/]
    • {/dede:arclist}
-
{/dede:channelartlist}{dede:channelartlist typeid='4,4'} +
{/dede:channelartlist}{dede:channelartlist typeid='19,19'}

{dede:field.typename/}

-
    {dede:arclist row='10' titlelen='120' orderby='id'} +
      {dede:arclist row='10' titlelen='120' orderby='rand'}
    • [field:global.autoindex/].[field:title/]
    • {/dede:arclist}
-
{/dede:channelartlist}{dede:channelartlist typeid='5,5'} +
{/dede:channelartlist}{dede:channelartlist typeid='17,17'}

{dede:field.typename/}

-
    {dede:arclist row='10' titlelen='120' orderby='id'} +
      {dede:arclist row='10' titlelen='120' orderby='rand'}
    • [field:global.autoindex/].[field:title/]
    • {/dede:arclist}
diff --git a/src/user/templets/album_add.htm b/src/user/templets/album_add.htm index ea19d610..8e8bd24e 100755 --- a/src/user/templets/album_add.htm +++ b/src/user/templets/album_add.htm @@ -16,7 +16,7 @@
-