- {dede:field.body/} - {dede:field.vote/} - (责任编辑:{dede:adminname/}) | -
diff --git a/src/plus/count.php b/src/plus/count.php index 8703449b..3d236b9c 100755 --- a/src/plus/count.php +++ b/src/plus/count.php @@ -19,6 +19,7 @@ if(isset($aid)) $arcID = $aid; $cid = empty($cid)? 1 : intval(preg_replace("/[^-\d]+[^\d]/",'', $cid)); $arcID = $aid = empty($arcID)? 0 : intval(preg_replace("/[^\d]/",'', $arcID)); +$format = isset($format)? $format : ""; $maintable = '#@__archives';$idtype='id'; if($aid==0) exit(); @@ -46,7 +47,18 @@ if(!empty($view)) $row = $dsql->GetOne(" SELECT click FROM `{$maintable}` WHERE {$idtype}='$aid' "); if(is_array($row)) { - echo "document.write('".$row['click']."');\r\n"; + if (!empty($format)) { + $result = array( + "code" => 200, + "data" => array( + 'click' => $row['click'], + ), + ); + echo json_encode($result); + } else { + echo "document.write('".$row['click']."');\r\n"; + } + } } exit(); \ No newline at end of file diff --git a/src/plus/stow.php b/src/plus/stow.php index bf3a1bff..e06d5825 100755 --- a/src/plus/stow.php +++ b/src/plus/stow.php @@ -1,51 +1,46 @@ M_ID==0) -{ - ShowMsg('只有会员才允许收藏操作!','javascript:window.close();'); - exit(); +if ($ml->M_ID == 0) { + ShowMsg('只有会员才允许收藏操作!', 'javascript:window.close();'); + exit(); } - //读取文档信息 $arcRow = GetOneArchive($aid); -if($arcRow['aid']=='') -{ - ShowMsg("无法收藏未知文档!","javascript:window.close();"); - exit(); +if ($arcRow['aid'] == '') { + ShowMsg("无法收藏未知文档!", "javascript:window.close();"); + exit(); } extract($arcRow, EXTR_SKIP); -$title = HtmlReplace($title,1); +$title = HtmlReplace($title, 1); $aid = intval($aid); $addtime = time(); -if($type==''){ - $row = $dsql->GetOne("Select * From `#@__member_stow` where aid='$aid' And mid='{$ml->M_ID}' AND type='' "); - if(!is_array($row)) - { - $dsql->ExecuteNoneQuery("INSERT INTO `#@__member_stow`(mid,aid,title,addtime) VALUES ('".$ml->M_ID."','$aid','".addslashes($arctitle)."','$addtime'); "); - } -}else{ - $row = $dsql->GetOne("Select * From `#@__member_stow` where type='$type' and (aid='$aid' And mid='{$ml->M_ID}')"); - if(!is_array($row)){ - $dsql->ExecuteNoneQuery(" INSERT INTO `#@__member_stow`(mid,aid,title,addtime,type) VALUES ('".$ml->M_ID."','$aid','$title','$addtime','$type'); "); - } +if ($type == '') { + $row = $dsql->GetOne("SELECT * FROM `#@__member_stow` WHERE aid='$aid' And mid='{$ml->M_ID}' AND type IS NULL "); + + if (!is_array($row)) { + $dsql->ExecuteNoneQuery("INSERT INTO `#@__member_stow`(mid,aid,title,addtime) VALUES ('" . $ml->M_ID . "','$aid','" . addslashes($arctitle) . "','$addtime'); "); + } +} else { + $row = $dsql->GetOne("SELECT * FROM `#@__member_stow` WHERE type='$type' AND (aid='$aid' AND mid='{$ml->M_ID}')"); + if (!is_array($row)) { + $dsql->ExecuteNoneQuery("INSERT INTO `#@__member_stow`(mid,aid,title,addtime,type) VALUES ('" . $ml->M_ID . "','$aid','$title','$addtime','$type'); "); + } } //更新用户统计 $row = $dsql->GetOne("SELECT COUNT(*) AS nums FROM `#@__member_stow` WHERE `mid`='{$ml->M_ID}' "); -$dsql->ExecuteNoneQuery("UPDATE #@__member_tj SET `stow`='$row[nums]' WHERE `mid`='".$ml->M_ID."'"); +$dsql->ExecuteNoneQuery("UPDATE `#@__member_tj` SET `stow`='{$row['nums']}' WHERE `mid`='" . $ml->M_ID . "'"); -ShowMsg('成功收藏一篇文档!','javascript:window.close();'); -?> \ No newline at end of file +ShowMsg('成功收藏一篇文档!', 'javascript:window.close();'); diff --git a/src/plus/view.php b/src/plus/view.php index 922cf6f9..8f7a2bdf 100755 --- a/src/plus/view.php +++ b/src/plus/view.php @@ -102,14 +102,6 @@ if($needMoney>0 || $needRank>1) showmsg('购买失败, 请返回', -1); exit; } - #api{{ - if(defined('UC_APPID')) - { - include_once DEDEROOT.'/api/uc.func.php'; - $row = $dsql->GetOne("SELECT `scores`,`userid` FROM `#@__member` WHERE `mid`='".$cfg_ml->M_ID."'"); - uc_credit_note($row['userid'],-$needMoney,'money'); - } - #/aip}} showmsg('购买成功,购买扣点不会重扣金币,谢谢!', '/plus/view.php?aid='.$aid); exit; diff --git a/src/static/css/dede.css b/src/static/css/dede.css new file mode 100644 index 00000000..a935aa54 --- /dev/null +++ b/src/static/css/dede.css @@ -0,0 +1,728 @@ +/* Copyright 2020 The [ZiXue.CN] Authors. All rights reserved. +license that can be found in the LICENSE file. */ + +.flink,.flink a,.copyright,.copyright a { + color: white; +} + +.copyright { + background-color: #12451F; + padding:.5em; +} + +form.search { + display: flex; + width: 100%; +} + +/* spec */ +ul.spec > li > a > img,.article-spec > a > img { + width: 120px; +} + +ul.spec .border-bottom-dashed { + border-bottom: dashed 1px #929292; +} + +ul.spec > li .title a { + color: #212529; +} + +ul.spec > li .title h4 { + display: inline; +} + +ul.spec > li .title .label { + background-color: #B7E9B4; + color: #008E38; + padding: 0 5px; + border-radius: 3px; +} + +ul.spec > li .description, ul.spec > li .description a { + color: #868686; + font-size: 16px; + line-height: 24px; + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + overflow: hidden; +} + +/* 通用列表 */ +ul.items > li .type { + background-color: #008E38; + color: white; + font-size: 14px; + height: 18px; + line-height: 18px; + position: relative; + padding: 0 5px; + top: -3px; + margin-right: 10px; +} + +ul.items > li .pane { + background-color: #008E38; + width: 10px; + height: 10px; + display: inline-block; + vertical-align: middle; + margin-right: 10px; + margin-bottom: 10px; +} + +ul.items > li .caption { + line-height: 32px; +} + +ul.items > li .title,ul.items > li .caption a { + display: inline; + line-height: 18px; + color: #212529; +} + +ul.items > li .description, ul.items > li .description a { + color: #868686; + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + overflow: hidden; + line-height: 26px; + word-break:break-all; +} + +ul.items .border-bottom-dashed { + border-bottom: dashed 1px #929292; +} + +ul.items > li .label { + border: 1px solid #FF8400; + color: #FF8400; + height: 24px; + border-radius: 3px; + font-size: 12px; + line-height: 24px; + margin-left: 5px; + padding: 0 5px; +} + +ul.items > li .label:hover { + border: 1px solid #FF8400; + color: white; + text-decoration-line: none; + background-color: #FF8400; + height: 24px; + border-radius: 3px; + font-size: 12px; + line-height: 24px; + margin-left: 5px; + padding: 0 5px; +} + +ul.items > li .source { + font-size: 14px; +} + +/* 自学网列表群组 */ +.list-group-dede { + text-align: center; + font-size: 16px; +} + +.dropdown-dede .dropdown-menu { + width: 100%; + text-align: center; +} + +.dropdown-dede .dropdown-menu>.dropdown-item.active { + background-color: white; + color: #FF8400; +} + +.dropdown-dede,.dropdown-dede a { + width: 100%; +} + +.dropdown-dede,.dropdown-item { + padding: .25rem 1.5rem; + text-align: left; + border-bottom: 1px dashed #D7D7D7; +} + +.dropdown-dede,.dropdown-item:last-child { + border-bottom: none; +} + +.list-group-dede .list-group-item.active { + z-index: 2; + color: #ff8400; + background-color: white; +} + +.list-group-dede { + border: 1px solid #96D6A8; + border-radius: 10px; +} + +.list-group-dede .list-group-item { + position: relative; + display: block; + padding: .75rem 1.25rem; + background-color: #fff; + border: none; + font-weight: 600; + border-bottom: 1px dashed #D7D7D7; +} + +.list-group-dede .list-group-item.active { + border: none; + border-bottom: 1px dashed #D7D7D7; +} +.list-group-dede .list-group-item+.list-group-item.active { + margin-top: 0px; +} + +.list-group-dede .list-group-item:last-child { + border-bottom: none; +} + +/* dedecard */ +.ddcard,.ddcard-normal { + border: none; +} + +.ddcard-normal{ + box-shadow: 1px 0px 5px 5px #F2F2F2; + padding: .25em; +} + +.ddcard-normal ul { + padding: .5em; +} + +.ddcard > .card-header { + background-color: white; + padding: 0; + border-bottom: solid 5px #008E38; +} + +.ddcard-normal > .card-header { + background-color: white; + padding: 0; + border-bottom: none; +} +.ddcard-normal > .card-header .caption { + font-size: 18px; + font-weight: 600; +} +.ddcard-normal > .card-header .caption a{ + color: #008E38; +} +.ddcard-normal > .card-header .caption::before { + content: " "; + background-color: #008E38; + padding: 4px; + margin-right: 10px; +} + +.ddcard > .card-header .caption { + font-size: 18px; +} + +.ddcard > .card-header .caption span { + display: inline-block; + background: #008E38; + padding: 5px 15px; + color: white; + margin-bottom: -3px; +} + +.ddcard > .card-header .more a,.ddcard-normal > .card-header .more a{ + color: #008E38; + font-size: 14px; + line-height: 26px; +} + +.ddcard > .list-group { + margin-left: 20px; +} + +.ddcard > .list-group .label,.ddcard-normal > .list-group .label { + float: right; + font-size: 14px; + padding: 3px; + color: #12451F; + background-color: #B6E9B4; + border-radius: 3px; + margin-left: 5px; +} + +.ddcard-normal > .list-group .time { + color: #C0C0C0; +} + +.ddcard-normal > ul > li,.ddcard-normal > ol > li { + border-bottom: dashed 1px #CFCFCF; + list-style: none; +} + +.ddcard-normal > ul > li.media img { + width: 75px; + height: 57px; +} + +.ddcard-normal > ul > li.media h4 { + font-size: 16px; +} + +.ddcard-normal .more { + padding-right: 1.5em; +} + + +.ddcard-normal > .list-group > li i { + color: #60B983; +} + +.ddcard > ul > li,.ddcard > ol > li,.ddcard-normal > ul > li,.ddcard-normal > ol > li { + padding: 5px 0; + color: #C0C0C0; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.ddcard > ul > li:nth-child(1),.ddcard > ol > li:nth-child(1), +.ddcard-normal > ul > li:nth-child(1),.ddcard-normal > ol > li:nth-child(1) { + margin-top: 10px; + overflow: hidden; + white-space: nowrap; + text-overflow: ellipsis; +} + +.ddcard > ul > li a ,.ddcard > ol > li a,.ddcard-normal > ul > li a ,.ddcard-normal > ol > li a{ + color: #272727; +} + +.ddcard > ol > li::before,.ddcard-normal > ol > li::before { + background-color: #FF8400; + color: white; + padding: 3px; + margin-left: -10px; + margin-right: 10px; + border-radius: 3px; +} + +.ddcard > ol > li:nth-child(1)::before,.ddcard-normal > ol > li:nth-child(1)::before { + content: "1"; + background-color: #FF8400; + color: white; + padding: 3px 6px; + margin-left: 0px; + margin-right: 10px; + border-radius: 3px; + width: 6px; +} + +.ddcard > ol > li:nth-child(2)::before,.ddcard-normal > ol > li:nth-child(2)::before { + content: "2"; + background-color: #FFB400; + color: white; + padding: 3px 5px; + margin-left: 0px; + margin-right: 10px; + border-radius: 3px; +} + +.ddcard > ol > li:nth-child(3)::before,.ddcard-normal > ol > li:nth-child(3)::before { + content: "3"; + background-color: #FFCC00; + color: white; + padding: 3px 5px; + margin-left: 0px; + margin-right: 10px; + border-radius: 3px; +} + +/* 特殊标题 */ +h1.dede::before { + content: " "; + background-color: #008E38; + padding: 4px; + margin-right: 10px; +} + +h2.dede::before { + content: " "; + background-color: #008E38; + padding: 4px; + margin-right: 10px; +} + +h3.dede::before { + content: " "; + background-color: #008E38; + padding: 4px; + margin-right: 10px; +} + +h4.dede::before { + content: " "; + background-color: #008E38; + padding: 4px; + margin-right: 10px; +} + +h5.dede::before { + content: " "; + background-color: #008E38; + padding: 4px; + margin-right: 10px; +} + +h3.dede-box::before { + content: " "; + background-color: #B7E9B4; + padding: 4px; + margin-bottom: 4px; + margin-right: 10px; + display: inline-block; +} + +h4.dede-box::before { + content: " "; + background-color: #B7E9B4; + padding: 4px; + margin-bottom: 4px; + margin-right: 10px; + display: inline-block; +} + +h5.dede-box::before { + content: " "; + background-color: #B7E9B4; + padding: 4px; + margin-bottom: 4px; + margin-right: 10px; + display: inline-block; +} + +/* 导航 */ +.nav.dede .nav-link { + color: #858585; + border: solid 1px #858585; +} + +.nav.dede .nav-link.active { + color: white; + border: solid 1px #FF8400; +} + +.nav.dede .nav-link:hover { + color: white; + background-color: #FF8400; + border: solid 1px #FF8400; +} + +.nav.dede .nav-link.disabled { + color: #6c757d; + pointer-events: none; + cursor: default; +} + +/* 站点全局导航部分 */ +nav.navbar.dede { + padding: 0; +} + +nav.navbar.dede .dropdown-item.active, .dropdown-item:active { + color:#ff8400; + text-decoration: none; + background-color:#fff; +} + +nav.navbar.dede .navbar-brand{ + display: none; +} + +nav.navbar.dede .nav-item{ + width: 7em; + text-align: center; + padding: .5em 0; +} + +nav.navbar.dede .nav-item.active{ + background-color: #ff8400; +} + +nav.location { + padding: .5em; + border: solid 1px #B5B5B5; + border-radius: 10px; + display: flex; + flex-direction: row; +} + +nav.location .caption{ + display: inline-block; + line-height: 20px; + font-size: 18px; + font-weight: 600; + color: #008E38; + width: 75px; + text-align: center; + padding: 0 5px 0 5px; + position: relative; +} + +nav.location .dede { + padding-inline-start: 0px; + margin-bottom: 0; +} + +nav.location .dede li { + float: left; + list-style-type: none; +} + +nav.location .dede li .nav-link { + color: #272727; +} + +nav.location .dede li.active .nav-link { + color: #ff8400; +} + +.dede-title > .dede, .dede-title > .dede-box { + display: inline-block; +} + +.dede-title > .items{ + display: inline-block; +} + +/* 面包屑 */ +.position .breadcrumb .breadcrumb-item a { + color: #008E38; +} + +/* 滚动到顶部 */ +#btnScrollTop { + display: none; + position: fixed; + bottom: 20px; + right: 20px; + z-index: 99; + font-size: 18px; + border: none; + outline: none; + background-color: #EC982C; + color: white; + cursor: pointer; + padding: 10px 15px; + border-radius: 10px; +} + +#btnScrollTop:hover { + background-color: #E77817; +} + +/*展开搜索*/ +.showhide-info .btn-show,.showhide-info .btn-hide{ + margin: 20px auto; +} + +/*展开状态*/ +.showhide-info.show .box { + height: 100%; +} +.showhide-info.show .btn-show{ + display: none; +} +.showhide-info.show .btn-hide{ + display: block; +} + +/*收缩状态*/ +.showhide-info.hide .box{ + height: 300px; + overflow: hidden; +} +.showhide-info.hide .btn-showhide{ + position: relative; + padding-top: 20px; + padding-bottom: 30px; +} +.showhide-info.hide .gradient{ + position: absolute; + top: -79px; + left: 0; + height: 80px; + width: 100%; + background-image: -webkit-gradient(linear,left top,left bottom,from(rgba(255,255,255,0)),to(#fff)); + background-image: -webkit-linear-gradient(top,rgba(255,255,255,0),#fff); + background-image: linear-gradient(-180deg,rgba(255,255,255,0),#fff); +} +.showhide-info.hide .btn-show{ + display: block; +} +.showhide-info.hide .btn-hide{ + display: none; +} + +/* 文章内容样式 */ +.article-main h2 { + line-height: 1.5em; +} + +.article-meta small { + color: #868686; + margin-left: 1em; +} + +.article-main .body { + word-break: break-all; +} + +.article-main .body img,.article-main .body video { + max-width: 100%!important; + height: auto !important; + visibility: visible !important; +} + +.article-main .body table { + width: 100% !important; +} + +/* 站点头部nav */ +.site-nav { + font-size: 14px; +} + +.site-nav .title b { + color: #ff8400; +} + +.site-nav .user a { + color: #008E38; +} + +@media only screen and (max-width: 1199px) { + .ddcard > .card-header .caption span { + font-size: 14px; + } +} + + +@media only screen and (max-width: 576px) { + .logo { + text-align: center; + } + + nav.navbar.dede .nav-item{ + width: 100%; + } + + nav.navbar.dede .navbar-brand{ + display: block; + margin-left: 10px; + } + + .dropdown-dede,.dropdown-item { + text-align: center; + } + + .ddcard > .card-header .caption span { + font-size: 16px; + } +} + +@media only screen and (max-width: 768px) { + + nav.navbar.dede .nav-item{ + width: 100%; + } + + nav.navbar.dede .navbar-brand{ + display: block; + margin-left: 10px; + } + + .dropdown-dede,.dropdown-item { + text-align: center; + } + + .ddcard > .card-header .caption span { + font-size: 14px; + } +} + +.digg .comment-container { + width: 200px; + padding: 10px 20px; + border: 1px solid #f2f2f2; + border-radius: 20px; + margin: 0 6px; + cursor: pointer; +} + +.digg .comment-container:hover { + background-color: #FFFCE0; +} + +.digg .comment-top { + display: flex; + flex-direction: row; + align-items: center; + margin-bottom: 10px; +} + +.digg .comment-top-text { + color: #497cf6; + margin-left: 10px; +} + +.digg .comment-top-text-danger { + color: #d21d35; + margin-left: 10px; +} + +.digg .text-like { + color: #497cf6; +} + +.digg .text-unlike { + color: #d21d35 +} + +.digg .comment-top p { + margin-bottom: unset; +} + + +.prenext .pagination-previous, .pagination-next { + font-size: 14px; + color: #a6a5a6; + padding: 6px 14px; + border-radius: 34px; + border: 1px solid #f0f0f0; + cursor: pointer; +} + +.prenext .pagination-previous:hover, .pagination-next:hover { + color: #c2e5d0; + background-color: #1eac5a; +} + +.actbox { + float: right; + padding:10px; +} +.actbox ul { + list-style: none; +} +.actbox ul li { + float: left; + margin-left: 10px; +} \ No newline at end of file diff --git a/src/static/img/admin-logo.png b/src/static/img/admin-logo.png new file mode 100644 index 00000000..c3146fa8 Binary files /dev/null and b/src/static/img/admin-logo.png differ diff --git a/src/static/img/avatar.png b/src/static/img/avatar.png new file mode 100644 index 00000000..e8bcdddb Binary files /dev/null and b/src/static/img/avatar.png differ diff --git a/src/static/img/logo.gif b/src/static/img/logo.gif new file mode 100644 index 00000000..7e1967d7 Binary files /dev/null and b/src/static/img/logo.gif differ diff --git a/src/static/img/member_bg.jpg b/src/static/img/member_bg.jpg new file mode 100644 index 00000000..405a53b3 Binary files /dev/null and b/src/static/img/member_bg.jpg differ diff --git a/src/static/img/member_home_bg.jpg b/src/static/img/member_home_bg.jpg new file mode 100644 index 00000000..fa0deb7c Binary files /dev/null and b/src/static/img/member_home_bg.jpg differ diff --git a/src/static/js/dede.js b/src/static/js/dede.js new file mode 100644 index 00000000..b39419eb --- /dev/null +++ b/src/static/js/dede.js @@ -0,0 +1,140 @@ +/* Copyright 2020 The ZiXue.CN Authors. All rights reserved. +license that can be found in the LICENSE file. */ + +// 滚动到页面顶部 +function gotop() { + $('html, body').animate({ scrollTop: 0 }, 'slow'); +} + +//读写cookie函数 +function GetCookie(c_name) +{ + if (document.cookie.length > 0) + { + c_start = document.cookie.indexOf(c_name + "=") + if (c_start != -1) + { + c_start = c_start + c_name.length + 1; + c_end = document.cookie.indexOf(";",c_start); + if (c_end == -1) + { + c_end = document.cookie.length; + } + return unescape(document.cookie.substring(c_start,c_end)); + } + } + return null +} + +function SetCookie(c_name,value,expiredays) +{ + var exdate = new Date(); + exdate.setDate(exdate.getDate() + expiredays); + document.cookie = c_name + "=" +escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toGMTString()); //使设置的有效时间正确。增加toGMTString() +} + +//------------------------------------------------------------------------------------------- +// 全局消息提示框 +//------------------------------------------------------------------------------------------- + +// 生成一个随机ID +function guid() { + function S4() { + return (((1 + Math.random()) * 0x10000) | 0).toString(16).substring(1); + } + return (S4() + S4() + "-" + S4() + "-" + S4() + "-" + S4() + "-" + S4() + S4() + S4()); +} + +// 显示对话框,动态创建modal并显示,退出自动销毁窗体 +// args是以下结构体 +/* +args = { + title : "", // 标题,默认是MuEMS + footer : "", // 底部按钮,可以自定义按钮 + noClose : false, // 是否显示右上角关闭按钮,默认显示 +} +*/ +// 函数会返回一个modalID,通过这个ID可自已定义一些方法 +// 这里用到了一个展开语法 +// https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Operators/Spread_syntax +function ShowMsg(content, ...args) { + title = "DedeCMS信息提示"; + if (typeof content == "undefined") content = ""; + modalID = guid(); + var footer = ``; + var noClose = false; + + if (args.length == 1) { + // 存在args参数 + if (typeof args[0].title !== 'undefined' && args[0].title != "") { + title = args[0].title; + } + if (typeof args[0].footer !== 'undefined' && args[0].footer != "") { + footer = args[0].footer; + } + if (typeof args[0].noClose !== 'undefined' && args[0].noClose == true) { + noClose = true; + } + } + + footer = footer.replace("~modalID~", modalID); + content = content.replace("~modalID~", modalID); + + var modal = `
`; + $("body").append(modal) + $("#DedeModal" + modalID).modal({ + backdrop: 'static', + show: true + }); + $("#DedeModal" + modalID).on('hidden.bs.modal', function (e) { + $("#DedeModal" + modalID).remove(); + }) + return modalID; +} + +// 隐藏并销毁modal +function CloseModal(modalID) { + $("#" + modalID).modal('hide'); + $("#" + modalID).on('hidden.bs.modal', function (e) { + if ($("#" + modalID).length > 0) { + $("#" + modalID).remove(); + } + }) +} + +// 在某个元素内显示alert信息 +function ShowAlert(ele, content, type, showtime = 3000) { + let msg = `- {dede:field.body/} - {dede:field.vote/} - (责任编辑:{dede:adminname/}) | -
[field:description function='cn_substr(@me,80)'/]...
-[field:info/]...[查看全文]
- {/dede:arclist}[field:msg/]
-[field:description/]...
-[field:description function='cn_substr(@me,80)'/]...
-- [field:description/]... -
-[field:description function='cn_substr(@me,80)'/]...
-
发表评论
+