| @@ -12,9 +12,6 @@ require_once(dirname(__FILE__).'/config.php'); | |||||
| CheckPurview('a_New,a_AccNew'); | CheckPurview('a_New,a_AccNew'); | ||||
| require_once(DEDEINC.'/customfields.func.php'); | require_once(DEDEINC.'/customfields.func.php'); | ||||
| require_once(DEDEADMIN.'/inc/inc_archives_functions.php'); | require_once(DEDEADMIN.'/inc/inc_archives_functions.php'); | ||||
| if (file_exists(DEDEDATA.'/template.rand.php')) { | |||||
| require_once(DEDEDATA.'/template.rand.php'); | |||||
| } | |||||
| if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
| if ($dopost != 'save') { | if ($dopost != 'save') { | ||||
| require_once(DEDEINC."/dedetag.class.php"); | require_once(DEDEINC."/dedetag.class.php"); | ||||
| @@ -12,9 +12,6 @@ require_once(dirname(__FILE__)."/config.php"); | |||||
| CheckPurview('a_Edit,a_AccEdit,a_MyEdit'); | CheckPurview('a_Edit,a_AccEdit,a_MyEdit'); | ||||
| require_once(DEDEINC."/customfields.func.php"); | require_once(DEDEINC."/customfields.func.php"); | ||||
| require_once(DEDEADMIN."/inc/inc_archives_functions.php"); | require_once(DEDEADMIN."/inc/inc_archives_functions.php"); | ||||
| if (file_exists(DEDEDATA.'/template.rand.php')) { | |||||
| require_once(DEDEDATA.'/template.rand.php'); | |||||
| } | |||||
| if (empty($dopost)) $dopost = ''; | if (empty($dopost)) $dopost = ''; | ||||
| $aid = isset($aid) && is_numeric($aid) ? $aid : 0; | $aid = isset($aid) && is_numeric($aid) ? $aid : 0; | ||||
| if ($dopost != 'save') { | if ($dopost != 'save') { | ||||
| @@ -69,10 +69,10 @@ | |||||
| <label for="dbname" class="form-label">数据库名称</label> | <label for="dbname" class="form-label">数据库名称</label> | ||||
| <div class="input-group"> | <div class="input-group"> | ||||
| <input type="text" name="dbname" id="dbname" class="form-control" placeholder="DedeBIZ"> | <input type="text" name="dbname" id="dbname" class="form-control" placeholder="DedeBIZ"> | ||||
| <div class="input-group-append"><button type="button" id="btnCheckConnect" class="btn btn-success">检查</button></div> | |||||
| <div class="input-group-append"><button type="button" id="dbtip" class="btn btn-success">检查</button></div> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <div id="alertConnect"></div> | |||||
| <div id="dbinfo"></div> | |||||
| <div class="form-group"> | <div class="form-group"> | ||||
| <label for="webname" class="form-label">网站名称</label> | <label for="webname" class="form-label">网站名称</label> | ||||
| <input type="text" name="webname" id="webname" class="form-control" placeholder="我的网站"> | <input type="text" name="webname" id="webname" class="form-control" placeholder="我的网站"> | ||||
| @@ -94,7 +94,7 @@ | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <script> | <script> | ||||
| $("#btnCheckConnect").click(function() { | |||||
| $("#dbtip").click(function() { | |||||
| let dbhost = $('#dbhost').val(); | let dbhost = $('#dbhost').val(); | ||||
| let dbuser = $('#dbuser').val(); | let dbuser = $('#dbuser').val(); | ||||
| let dbpwd = $('#dbpwd').val(); | let dbpwd = $('#dbpwd').val(); | ||||
| @@ -104,17 +104,17 @@ | |||||
| console.log(rs); | console.log(rs); | ||||
| let result = JSON.parse(rs); | let result = JSON.parse(rs); | ||||
| if (result.code === 200) { | if (result.code === 200) { | ||||
| ShowAlert("#alertConnect", result.data, "success", 3000); | |||||
| ShowAlert("#dbinfo", result.data, "success", 3000); | |||||
| } else { | } else { | ||||
| ShowAlert("#alertConnect", result.data, "danger", 3000); | |||||
| ShowAlert("#dbinfo", result.data, "danger", 3000); | |||||
| } | } | ||||
| }) | }) | ||||
| }); | }); | ||||
| $("#dbtype").change(function() { | $("#dbtype").change(function() { | ||||
| if ($(this).val() === 'sqlite') { | if ($(this).val() === 'sqlite') { | ||||
| $(".form-group.server").hide() | |||||
| $(".form-group.server").hide(); | |||||
| } else { | } else { | ||||
| $(".form-group.server").show() | |||||
| $(".form-group.server").show(); | |||||
| } | } | ||||
| }); | }); | ||||
| </script> | </script> | ||||
| @@ -105,9 +105,15 @@ class TagList | |||||
| } | } | ||||
| if (isset($GLOBALS['PageNo'])) { | if (isset($GLOBALS['PageNo'])) { | ||||
| $this->PageNo = intval($GLOBALS['PageNo']); | $this->PageNo = intval($GLOBALS['PageNo']); | ||||
| if ($this->PageNo == 0) { | |||||
| $this->PageNo = 1; | |||||
| } | |||||
| } else { | } else { | ||||
| $this->PageNo = 1; | $this->PageNo = 1; | ||||
| } | } | ||||
| if (stripos(GetCurUrl(), 'makehtml_taglist_action.php')) { | |||||
| $this->TotalResult = 1; | |||||
| } | |||||
| if ($this->TotalResult == -1) { | if ($this->TotalResult == -1) { | ||||
| $cquery = "SELECT COUNT(*) AS dd FROM `#@__taglist` WHERE tid = '{$this->TagInfos['id']}' AND arcrank >-1 "; | $cquery = "SELECT COUNT(*) AS dd FROM `#@__taglist` WHERE tid = '{$this->TagInfos['id']}' AND arcrank >-1 "; | ||||
| $row = $this->dsql->GetOne($cquery); | $row = $this->dsql->GetOne($cquery); | ||||
| @@ -115,16 +121,16 @@ class TagList | |||||
| //更新Tag信息 | //更新Tag信息 | ||||
| $ntime = time(); | $ntime = time(); | ||||
| //更新浏览量和记录数 | //更新浏览量和记录数 | ||||
| $upquery = "UPDATE `#@__tagindex` SET total='{$row['dd']}',count=count+1,weekcc=weekcc+1,monthcc=monthcc+1 WHERE tag LIKE '{$this->Tag}' "; | |||||
| $upquery = "UPDATE `#@__tagindex` SET total='{$row['dd']}',count=count+1,weekcc=weekcc+1,monthcc=monthcc+1 WHERE tag LIKE '{$this->TagInfos['tag']}' "; | |||||
| $this->dsql->ExecuteNoneQuery($upquery); | $this->dsql->ExecuteNoneQuery($upquery); | ||||
| $oneday = 24 * 3600; | $oneday = 24 * 3600; | ||||
| //周统计 | //周统计 | ||||
| if (ceil(($ntime - $this->TagInfos['weekup']) / $oneday) > 7) { | if (ceil(($ntime - $this->TagInfos['weekup']) / $oneday) > 7) { | ||||
| $this->dsql->ExecuteNoneQuery("UPDATE `#@__tagindex` SET weekcc=0,weekup='{$ntime}' WHERE tag LIKE '{$this->Tag}' "); | |||||
| $this->dsql->ExecuteNoneQuery("UPDATE `#@__tagindex` SET weekcc=0,weekup='{$ntime}' WHERE tag LIKE '{$this->TagInfos['tag']}' "); | |||||
| } | } | ||||
| //月统计 | //月统计 | ||||
| if (ceil(($ntime - $this->TagInfos['monthup']) / $oneday) > 30) { | if (ceil(($ntime - $this->TagInfos['monthup']) / $oneday) > 30) { | ||||
| $this->dsql->ExecuteNoneQuery("UPDATE `#@__tagindex` SET monthcc=0,monthup='{$ntime}' WHERE tag LIKE '{$this->Tag}' "); | |||||
| $this->dsql->ExecuteNoneQuery("UPDATE `#@__tagindex` SET monthcc=0,monthup='{$ntime}' WHERE tag LIKE '{$this->TagInfos['tag']}' "); | |||||
| } | } | ||||
| } | } | ||||
| $ctag = $this->dtp->GetTag("page"); | $ctag = $this->dtp->GetTag("page"); | ||||