From 66f402eac8bd03cff325af0546e4548214f46c28 Mon Sep 17 00:00:00 2001 From: tianya Date: Thu, 24 Dec 2020 12:30:58 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=91=BD=E4=BB=A4=E8=A1=8C?= =?UTF-8?q?=E5=B7=A5=E5=85=B7=EF=BC=8C=E6=94=AF=E6=8C=81=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E8=A1=8C=E7=94=9F=E6=88=90=E9=9D=99=E6=80=81=E6=96=87=E4=BB=B6?= =?UTF-8?q?=EF=BC=8C=E4=BF=AE=E5=A4=8D=E8=8B=A5=E5=B9=B2=E5=AE=89=E5=85=A8?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- dedebiz | 265 ++++++++++- src/data/admin/source.txt | 9 +- src/dede/mail_send.php | 36 +- src/dede/mail_title_send.php | 41 +- src/dede/makehtml_list_action.php | 2 +- src/dede/templets/makehtml_homepage.htm | 82 ++-- src/include/arc.archives.class.php | 29 +- src/include/arc.caicai.class.php | 262 ----------- src/include/arc.listview.class.php | 3 + src/include/arc.memberlistview.class.php | 442 ------------------ src/include/arc.partview.class.php | 2 +- src/include/arc.sglistview.class.php | 3 + src/include/autoload.inc.php | 5 - src/include/autoload7.inc.php | 11 +- src/include/cli.class.php | 398 ++++++++++++++++ src/include/common.func.php | 2 +- src/include/common.inc.php | 19 +- src/include/dedebiz.class.php | 28 +- src/include/dedesqli.class.php | 18 +- src/include/helpers/channelunit.helper.php | 7 +- src/include/typeunit.class.selector.php | 6 +- src/include/wap.inc.php | 111 ----- src/install/index.php | 391 ---------------- src/install/module-install.php | 120 ----- src/member/check_card.php | 2 +- src/member/config.php | 18 +- src/member/control.php | 10 - src/member/edit_email.php | 38 ++ src/member/feedback.php | 13 - src/member/flink_main.php | 105 ----- src/member/inc/inc_pwd_functions.php | 25 +- src/member/index_do.php | 24 +- src/member/mail.php | 123 ----- src/member/mypay.php | 4 +- src/member/pm.php | 79 +--- src/member/reg_new.php | 40 +- src/member/shops_orders.php | 4 +- src/member/shops_point.php | 6 +- src/member/shops_products.php | 16 +- src/member/soft_add.php | 1 + src/member/soft_edit.php | 1 + src/member/templets/edit_baseinfo.htm | 3 + src/member/templets/edit_email.htm | 68 +++ src/member/templets/edit_face.htm | 3 + src/member/templets/index-notlogin.htm | 1 + src/member/templets/login.htm | 1 + src/member/templets/mail.htm | 60 --- src/member/templets/mail_drop.htm | 67 --- src/member/templets/menu.htm | 3 + src/member/templets/resetpassword2.htm | 2 +- src/plus/recommend.php | 23 +- .../ckeditor/plugins/dedepagebreak/plugin.js | 2 +- src/static/lurd/base.css | 157 ------- src/static/lurd/button_back.gif | Bin 445 -> 0 bytes src/static/lurd/button_reset.gif | Bin 421 -> 0 bytes src/static/lurd/button_save.gif | Bin 447 -> 0 bytes src/static/lurd/ico-del.png | Bin 601 -> 0 bytes src/static/lurd/ico-edit.png | Bin 607 -> 0 bytes src/static/lurd/ico-sadd.png | Bin 1308 -> 0 bytes src/static/lurd/tr-bg.gif | Bin 242 -> 0 bytes src/templets/plus/view_msg.htm | 143 +++--- 61 files changed, 1110 insertions(+), 2224 deletions(-) delete mode 100755 src/include/arc.caicai.class.php delete mode 100755 src/include/arc.memberlistview.class.php create mode 100644 src/include/cli.class.php delete mode 100755 src/include/wap.inc.php delete mode 100644 src/install/index.php delete mode 100644 src/install/module-install.php delete mode 100755 src/member/control.php create mode 100644 src/member/edit_email.php delete mode 100755 src/member/feedback.php delete mode 100755 src/member/flink_main.php delete mode 100755 src/member/mail.php create mode 100644 src/member/templets/edit_email.htm delete mode 100755 src/member/templets/mail.htm delete mode 100755 src/member/templets/mail_drop.htm delete mode 100755 src/static/lurd/base.css delete mode 100755 src/static/lurd/button_back.gif delete mode 100755 src/static/lurd/button_reset.gif delete mode 100755 src/static/lurd/button_save.gif delete mode 100755 src/static/lurd/ico-del.png delete mode 100755 src/static/lurd/ico-edit.png delete mode 100755 src/static/lurd/ico-sadd.png delete mode 100755 src/static/lurd/tr-bg.gif diff --git a/dedebiz b/dedebiz index 66ecd831..7b5661eb 100755 --- a/dedebiz +++ b/dedebiz @@ -1,9 +1,9 @@ #!/usr/bin/env php 1 && $argv[1] == "serv") { +// 将选项转化为SQL IN参数 +function Option2SQLin($str = "") +{ + $str = preg_replace("#[^0-9-,]#", "", $str); + $strs = explode(",", $str); + foreach ($strs as $key => $si) { + if (preg_match("#-#", $si)) { + $tstart = 0; + $tend = 0; + $tss = explode("-", $si); + if (intval($tss[0]) > intval($tss[1])) { + $tstart = intval($tss[1]); + $tend = intval($tss[0]); + } else { + $tstart = intval($tss[0]); + $tend = intval($tss[1]); + } + $tmpArr = array(); + for ($i = $tstart; $i <= $tend; $i++) { + $tmpArr[] = $i; + } + $strs[$key] = implode(",", $tmpArr); + } + } + return implode(",", $strs); +} + +if (count($argv) > 1 && ($argv[1] == "serv" || $argv[1] == "s")) { // PHP5.4以下不支持内建服务器 // 用于开发调试 if (phpversion() < "5.4") { @@ -26,4 +66,223 @@ if (count($argv) > 1 && $argv[1] == "serv") { echo "Start Dev Server For DedeCMSV6\n\r"; echo "Open http://localhost:8088\n\r"; passthru(PHP_BINARY . ' -S localhost:8088 -t' . escapeshellarg('./')); +} else if (count($argv) > 1 && $argv[1] == "make") { + if (!file_exists($workDir . "/include/common.inc.php")) { + DedeCli::error("Check your root path is right"); + exit; + } + + require_once($workDir . "/include/common.inc.php"); + require_once(DEDEINC . "/cli.class.php"); + + // 一个命令行的生成工具 + if (count($argv) > 2 && ($argv[2] == "arc" || $argv[2] == "a")) { + // 生成文档 + // make arc typeid=1 + $t1 = ExecTime(); + $addsql = "1=1"; + $typeid = Option2SQLin(DedeCli::getOption("typeid")); + if (!empty($typeid)) { + $addsql .= " AND typeid IN(" . $typeid . ")"; + } + $aid = Option2SQLin(DedeCli::getOption("aid")); + if (!empty($aid)) { + $addsql .= " AND id IN(" . $typeid . ")"; + } + + $tt = $dsql->GetOne("SELECT COUNT(id) as dd FROM `#@__arctiny` WHERE " . $addsql); + $total = intval($tt['dd']); + $dsql->Execute('out', "SELECT id FROM `#@__arctiny` WHERE " . $addsql . " ORDER BY typeid ASC"); + $i = 0; + while ($row = $dsql->GetObject('out')) { + $id = $row->id; + $ac = new Archives($id); + $rurl = $ac->MakeHtml(0); + DedeCli::showProgress(ceil(($i / $total) * 100), 100); + $i++; + } + DedeCli::write("Make archive html successfull"); + $queryTime = ExecTime() - $t1; + DedeCli::write($queryTime); + exit; + } else if (count($argv) > 2 && ($argv[2] == "list" || $argv[2] == "l")) { + // 生成栏目 + $addsql = "1=1"; + $typeid = Option2SQLin(DedeCli::getOption("typeid")); + if (!empty($typeid)) { + $addsql .= " AND id IN(" . $typeid . ")"; + } + $dsql->Execute('out', "SELECT id,channeltype FROM `#@__arctype` WHERE " . $addsql); + $i = 0; + while ($row = $dsql->GetObject('out')) { + if ($row->channeltype > 0) { + $lv = new ListView($row->id); + } else { + $lv = new SgListView($row->id); + } + $lv->CountRecord(); + DedeCli::write("Start make list html[id:{$row->id}]"); + $lv->MakeHtml('', '', 0); + } + exit; + } else if (count($argv) > 2 && ($argv[2] == "index" || $argv[2] == "i")) { + // 生成首页 + $position = DedeCli::getOption("position"); + if (empty($position)) { + $position = "../index.html"; + } + if (!preg_match("#\.html$#", $position)) { + DedeCli::error("position must end with .html"); + exit; + } + $homeFile = DEDEINC . "/" . $position; + $homeFile = str_replace("\\", "/", $homeFile); + $homeFile = str_replace("//", "/", $homeFile); + $row = $dsql->GetOne("SELECT * FROM `#@__homepageset`"); + $templet = $row['templet']; + $templet = str_replace("{style}", $cfg_df_style, $templet); + $pv = new PartView(); + $GLOBALS['_arclistEnv'] = 'index'; + $pv->SetTemplet($cfg_basedir . $cfg_templets_dir . "/" . $templet); + $pv->SaveToHtml($homeFile); + DedeCli::write("Make index html successfull"); + } else if (count($argv) > 2 && ($argv[2] == "auto" || $argv[2] == "o")) { + // 自动生成 + function OptimizeData($dsql) + { + global $cfg_dbprefix; + $tptables = array("{$cfg_dbprefix}archives", "{$cfg_dbprefix}arctiny"); + $dsql->SetQuery("SELECT maintable,addtable FROM `#@__channeltype` "); + $dsql->Execute(); + while ($row = $dsql->GetObject()) { + $addtable = str_replace('#@__', $cfg_dbprefix, $row->addtable); + if ($addtable != '' && !in_array($addtable, $tptables)) $tptables[] = $addtable; + } + $tptable = ''; + foreach ($tptables as $t) $tptable .= ($tptable == '' ? "`{$t}`" : ",`{$t}`"); + $dsql->ExecuteNoneQuery(" OPTIMIZE TABLE $tptable; "); + } + $start = empty(DedeCli::getOption("start"))? "-1 day" : DedeCli::getOption("start"); + $start = strtotime($start); + if (!$start) { + DedeCli::error("start is empty"); + exit; + } + + // 1.生成首页 + $pv = new PartView(); + $row = $pv->dsql->GetOne("SELECT * FROM `#@__homepageset` "); + $templet = str_replace("{style}", $cfg_df_style, $row['templet']); + $homeFile = DEDEINC . '/' . $row['position']; + $homeFile = str_replace("\\", '/', $homeFile); + $homeFile = preg_replace("#\/{1,}#", '/', $homeFile); + if ($row['showmod'] == 1) { + $pv->SetTemplet($cfg_basedir . $cfg_templets_dir . '/' . $templet); + $pv->SaveToHtml($homeFile); + $pv->Close(); + } else { + if (file_exists($homeFile)) @unlink($homeFile); + } + DedeCli::write("Make index html successfull"); + // 2.生成栏目 + $query = "SELECT DISTINCT typeid From `#@__arctiny` WHERE senddate >=" . $start . " AND arcrank>-1"; + $dsql->SetQuery($query); + $dsql->Execute(); + $typeids = array(); + while ($row = $dsql->GetArray()) { + $typeids[$row['typeid']] = 1; + } + if (count($typeids) > 0) { + foreach ($typeids as $k => $v) { + $vs = array(); + $vs = GetParentIds($k); + if (!isset($typeidsok[$k])) { + $typeidsok[$k] = 1; + } + foreach ($vs as $k => $v) { + if (!isset($typeidsok[$v])) { + $typeidsok[$v] = 1; + } + } + } + foreach ($typeidsok as $tt=> $k) { + $row = $dsql->GetOne("SELECT id,channeltype FROM `#@__arctype` WHERE id=".$tt); + if ($row['channeltype'] > 0) { + $lv = new ListView($tt); + } else { + $lv = new SgListView($tt); + } + $lv->CountRecord(); + DedeCli::write("Start make list html[id:{$tt}]"); + $lv->MakeHtml('', '', 0); + } + DedeCli::write("Make list html successfull"); + } + + // 生成文档 + $tt = $dsql->GetOne("SELECT COUNT(id) as dd FROM `#@__arctiny` WHERE senddate >=" . $start . " AND arcrank>-1"); + $total = intval($tt['dd']); + $dsql->Execute('out', "SELECT id FROM `#@__arctiny` WHERE senddate >=" . $start . " AND arcrank>-1 ORDER BY typeid ASC"); + $i = 0; + while ($row = $dsql->GetObject('out')) { + $id = $row->id; + $ac = new Archives($id); + $rurl = $ac->MakeHtml(0); + DedeCli::showProgress(ceil(($i / $total) * 100), 100); + $i++; + } + DedeCli::write("Make archives html successfull"); + + // 优化数据 + OptimizeData($dsql); + DedeCli::write("Optimize data successfull"); + } else { + $helpStr = " + USAGE: + php ./dedebiz make action [arguments...] + ACTIONS: + index,i Make Index html + --position index html position,default: ../index.html(relative include dir) + arc,a Make Archive htmls + --typeid type id + --aid archive id + list,l Make List htmls + --typeid type id + auto,o Auto Make htmls + --start start time(format:2012-03-12) + WEBSITE: + https://www.dedebiz.com/help/"; + DedeCli::write($helpStr); + exit; + } +} else if (count($argv) > 1 && ($argv[1] == "update" || $argv[1] == "u")) { + define("DEDEINC", $workDir."/include"); + require_once(DEDEINC."/dedehttpdown.class.php"); + require_once(DEDEINC . "/cli.class.php"); + // 更新系统 + $latestURL = "https://cdn.dedebiz.com/release/latest.txt"; + $del = new DedeHttpDown(); + $del->OpenUrl($latestURL); + $remoteVerStr = $del->GetHtml(); + $commStr = file_get_contents(DEDEINC."/common.inc.php"); + preg_match("#_version_detail = '([\d\.]+)'#", $commStr, $matchs); + $cfg_version_detail = $localVerStr = $matchs[1]; + if (version_compare($localVerStr, $remoteVerStr, '>=')) { + DedeCli::error("latest version,don't need to update"); + exit; + } + + $fileHashURL = "https://cdn.dedebiz.com/release/{$cfg_version_detail}.json"; + $del = new DedeHttpDown(); + $del->OpenUrl($fileHashURL); + $filelist = $del->GetJSON(); + $offFiles = array(); + // foreach ($filelist as $key => $ff) { + // $offFiles[$ff->filename] = $ff->hash; + // } + + + var_dump($filelist); +} else { + echo $helpStr; } diff --git a/src/data/admin/source.txt b/src/data/admin/source.txt index f54ff330..2230f85a 100755 --- a/src/data/admin/source.txt +++ b/src/data/admin/source.txt @@ -1,5 +1,4 @@ -Admin5 -ChinaZ -织梦技术论坛 -落伍者论坛 -DedeBIZ \ No newline at end of file +DedeBIZ +今日头条 +微信公众号 +百家号 \ No newline at end of file diff --git a/src/dede/mail_send.php b/src/dede/mail_send.php index 877ce4e9..4da64708 100755 --- a/src/dede/mail_send.php +++ b/src/dede/mail_send.php @@ -5,20 +5,29 @@ CheckPurview('plus_Mail'); //邮件发送函数 function sendmail($email, $mailtitle, $mailbody) { - global $cfg_sendmail_bysmtp, $cfg_smtp_server, $cfg_smtp_port, $cfg_smtp_usermail, $cfg_smtp_user, $cfg_smtp_password, $cfg_adminemail,$cfg_webname; - if($cfg_sendmail_bysmtp == 'Y' && !empty($cfg_smtp_server)) - { - $mailtype = 'HTML'; - require_once(DEDEINC.'/mail.class.php'); - $smtp = new smtp($cfg_smtp_server,$cfg_smtp_port,true,$cfg_smtp_usermail,$cfg_smtp_password); - $smtp->debug = false; - if(!$smtp->smtp_sockopen($cfg_smtp_server)){ - ShowMsg('邮件发送失败,请联系管理员','-1'); - exit(); + global $cfg_sendmail_bysmtp, $cfg_smtp_server, $cfg_smtp_port, $cfg_smtp_usermail, $cfg_smtp_password, $cfg_webname; + global $cfg_bizcore_appid,$cfg_bizcore_key,$cfg_bizcore_hostname,$cfg_bizcore_port; + if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { + $client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port); + $client->appid = $cfg_bizcore_appid; + $client->key = $cfg_bizcore_key; + $client->MailSend($email,$mailtitle,$mailtitle,$mailbody); + $client->Close(); + } else { + if($cfg_sendmail_bysmtp == 'Y' && !empty($cfg_smtp_server)) + { + $mailtype = 'HTML'; + require_once(DEDEINC.'/mail.class.php'); + $smtp = new smtp($cfg_smtp_server,$cfg_smtp_port,true,$cfg_smtp_usermail,$cfg_smtp_password); + $smtp->debug = false; + if(!$smtp->smtp_sockopen($cfg_smtp_server)){ + ShowMsg('邮件发送失败,请联系管理员','-1'); + exit(); + } + $smtp->sendmail($email,$cfg_webname,$cfg_smtp_usermail, $mailtitle, $mailbody, $mailtype); + }else{ + @mail($email, $mailtitle, $mailbody, $headers); } - $smtp->sendmail($email,$cfg_webname,$cfg_smtp_usermail, $mailtitle, $mailbody, $mailtype); - }else{ - @mail($email, $mailtitle, $mailbody, $headers); } } @@ -83,4 +92,3 @@ if($action=="post"){ exit(); } -?> \ No newline at end of file diff --git a/src/dede/mail_title_send.php b/src/dede/mail_title_send.php index 3e86ade4..ad8644d6 100755 --- a/src/dede/mail_title_send.php +++ b/src/dede/mail_title_send.php @@ -7,20 +7,29 @@ if($dopost=="send"){ //邮件发送函数 function sendmail($email, $mailtitle, $mailbody) { - global $cfg_sendmail_bysmtp, $cfg_smtp_server, $cfg_smtp_port, $cfg_smtp_usermail, $cfg_smtp_user, $cfg_smtp_password, $cfg_adminemail,$cfg_webname; - if($cfg_sendmail_bysmtp == 'Y' && !empty($cfg_smtp_server)) - { - $mailtype = 'HTML'; - require_once(DEDEINC.'/mail.class.php'); - $smtp = new smtp($cfg_smtp_server,$cfg_smtp_port,true,$cfg_smtp_usermail,$cfg_smtp_password); - $smtp->debug = false; - if(!$smtp->smtp_sockopen($cfg_smtp_server)){ - ShowMsg('邮件发送失败,请联系管理员','-1'); - exit(); - } - $smtp->sendmail($email,$cfg_webname,$cfg_smtp_usermail, $mailtitle, $mailbody, $mailtype); - }else{ - @mail($email, $mailtitle, $mailbody, $headers); + global $cfg_sendmail_bysmtp, $cfg_smtp_server, $cfg_smtp_port, $cfg_smtp_usermail, $cfg_smtp_password, $cfg_webname; + global $cfg_bizcore_appid,$cfg_bizcore_key,$cfg_bizcore_hostname,$cfg_bizcore_port; + if (!empty($cfg_bizcore_appid) && !empty($cfg_bizcore_key)) { + $client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port); + $client->appid = $cfg_bizcore_appid; + $client->key = $cfg_bizcore_key; + $client->MailSend($email,$mailtitle,$mailtitle,$mailbody); + $client->Close(); + } else { + if($cfg_sendmail_bysmtp == 'Y' && !empty($cfg_smtp_server)) + { + $mailtype = 'HTML'; + require_once(DEDEINC.'/mail.class.php'); + $smtp = new smtp($cfg_smtp_server,$cfg_smtp_port,true,$cfg_smtp_usermail,$cfg_smtp_password); + $smtp->debug = false; + if(!$smtp->smtp_sockopen($cfg_smtp_server)){ + ShowMsg('邮件发送失败,请联系管理员','-1'); + exit(); + } + $smtp->sendmail($email,$cfg_webname,$cfg_smtp_usermail, $mailtitle, $mailbody, $mailtype); + }else{ + @mail($email, $mailtitle, $mailbody, $headers); + } } } @@ -44,7 +53,7 @@ if($dopost=="send"){ $sendtime = time(); $inquery = "UPDATE `#@__mail_title` SET count=count+1,sendtime='$sendtime',state='1' WHERE id=$id"; - if($dsql->ExecuteNoneQuery($inquery)){ + if($dsql->ExecuteNoneQuery($inquery)){ ShowMsg('邮件已成功发送','mail_title_send.php'); exit(); } @@ -72,5 +81,3 @@ if($dopost=="send"){ $dlist->SetSource($sql); $dlist->display(); } - -?> \ No newline at end of file diff --git a/src/dede/makehtml_list_action.php b/src/dede/makehtml_list_action.php index 37b46ada..1661d50d 100755 --- a/src/dede/makehtml_list_action.php +++ b/src/dede/makehtml_list_action.php @@ -62,7 +62,7 @@ if (isset($idArray[$pageno])) { if ($pageno == 0 && $mkpage == 1) //清空缓存 { - $dsql->ExecuteNoneQuery("Delete From `#@__arccache` "); + $dsql->ExecuteNoneQuery("DELETE FROM `#@__arccache` "); } $reurl = ''; diff --git a/src/dede/templets/makehtml_homepage.htm b/src/dede/templets/makehtml_homepage.htm index 08c09e58..f86719da 100755 --- a/src/dede/templets/makehtml_homepage.htm +++ b/src/dede/templets/makehtml_homepage.htm @@ -86,48 +86,58 @@ appid = $cfg_bizcore_appid; - $client->key = $cfg_bizcore_key; - $data = $client->AdminPWDExists(); - $data = json_decode($data->data); - $rs = (array)($data->result); + $client = new DedeBizClient($cfg_bizcore_hostname, $cfg_bizcore_port); + $client->appid = $cfg_bizcore_appid; + $client->key = $cfg_bizcore_key; + $data = $client->AdminPWDExists(); + $data = json_decode($data->data); + $rs = (array)($data->result); - if($rs["admin_pwd_exists"] == "false") {?> + if($rs["admin_pwd_exists"] == "false") {?> + + 设置DedeBIZ操作密码: + + + 设定后所有的DedeBIZ涉及安全操作输入当前操作密码 + + + + 重复DedeBIZ操作密码: + + + + + + + DedeBIZ操作密码: + + + + + + 首页状态: + + + + + + - 设置DedeBIZ操作密码: - - - 设定后所有的DedeBIZ涉及安全操作输入当前操作密码 - - - - 重复DedeBIZ操作密码: - - - - - - - DedeBIZ操作密码: - - + + 尚未开启DedeBIZ商业组件 如何启动组件 - - 首页状态: - - - - - + ?> +