| @@ -9,5 +9,27 @@ | |||||
| * @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
| */ | */ | ||||
| require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
| $tid = isset($tid)? $tid : 0; | |||||
| $tagid = isset($tagid)? (int)$tagid : 0; | |||||
| $action = isset($action)? $action : ''; | |||||
| $search = isset($search)? HtmlReplace($search, 0) : ''; | |||||
| if ($action == "search") { | |||||
| if (!empty($search)) { | |||||
| $sql="select * from #@__tagindex where tag like '%$search%' order by id desc"; | |||||
| $dsql->Execute('al',$sql); | |||||
| $result = array(); | |||||
| while($row=$dsql->GetObject('al')){ | |||||
| $row->text= $row->tag; | |||||
| $result[] = $row; | |||||
| } | |||||
| $result = array( | |||||
| "code" => 200, | |||||
| "data" => $result, | |||||
| ); | |||||
| echo json_encode($result); | |||||
| } | |||||
| exit; | |||||
| } | |||||
| include DedeInclude('templets/makehtml_taglist.htm'); | include DedeInclude('templets/makehtml_taglist.htm'); | ||||
| @@ -27,10 +27,8 @@ if ($tagid > 0) { | |||||
| } | } | ||||
| $allfinish = false; //是否全部完成 | $allfinish = false; //是否全部完成 | ||||
| $dd = $dsql->GetOne("SELECT ROUND(AVG(total)) as tt FROM `#@__tagindex`"); //取一个平均 | |||||
| if ($upall == 1 && $ctagid == 0) { | if ($upall == 1 && $ctagid == 0) { | ||||
| $rr = $dsql->GetOne("SELECT * FROM `#@__tagindex` WHERE mktime <> uptime AND total > {$dd['tt']} LIMIT 1"); | |||||
| $rr = $dsql->GetOne("SELECT * FROM `#@__tagindex` WHERE mktime <> uptime LIMIT 1"); | |||||
| if (!empty($rr) && count($rr) > 0) { | if (!empty($rr) && count($rr) > 0) { | ||||
| $ctagid = $rr['id']; | $ctagid = $rr['id']; | ||||
| } else { | } else { | ||||
| @@ -39,6 +37,9 @@ if ($upall == 1 && $ctagid == 0) { | |||||
| } | } | ||||
| if ($ctagid == 0 && $allfinish) { | if ($ctagid == 0 && $allfinish) { | ||||
| $dlist = new TagList('', 'tag.htm'); | |||||
| $dlist->MakeHtml(1, 10); | |||||
| $reurl = '../a/tags/'; | $reurl = '../a/tags/'; | ||||
| ShowMsg("完成TAG更新<a href='$reurl' target='_blank'>浏览TAG首页</a>", "javascript:;"); | ShowMsg("完成TAG更新<a href='$reurl' target='_blank'>浏览TAG首页</a>", "javascript:;"); | ||||
| exit; | exit; | ||||
| @@ -3,8 +3,35 @@ | |||||
| <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>"> | <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>"> | ||||
| <title>更新标签</title> | <title>更新标签</title> | ||||
| <link rel="stylesheet" href="../static/css/bootstrap.min.css"> | <link rel="stylesheet" href="../static/css/bootstrap.min.css"> | ||||
| <link rel="stylesheet" href="../static/css/select2.min.css"> | |||||
| <link rel="stylesheet" href="../static/font-awesome/css/font-awesome.min.css"> | <link rel="stylesheet" href="../static/font-awesome/css/font-awesome.min.css"> | ||||
| <link rel="stylesheet" href="css/base.css"> | <link rel="stylesheet" href="css/base.css"> | ||||
| <script language="javascript" src="../static/js/jquery.min.js"></script> | |||||
| <script language="javascript" src="../static/js/select2.full.min.js"></script> | |||||
| <script language="javascript" src="../static/js/i18n/zh-CN.js"></script> | |||||
| <script> | |||||
| $(function(){ | |||||
| $('#tagid').select2({ | |||||
| language: "zh-CN", | |||||
| ajax: { | |||||
| url: 'makehtml_taglist.php?action=search', | |||||
| delay: 500, | |||||
| data: function (params) { | |||||
| var query = { | |||||
| search: params.term, | |||||
| } | |||||
| return query; | |||||
| }, | |||||
| processResults: function (data) { | |||||
| data = JSON.parse(data); | |||||
| return { | |||||
| results: data.data | |||||
| }; | |||||
| } | |||||
| } | |||||
| }); | |||||
| }); | |||||
| </script> | |||||
| </head> | </head> | ||||
| <body background='images/allbg.gif' leftmargin='8' topmargin='8'> | <body background='images/allbg.gif' leftmargin='8' topmargin='8'> | ||||
| <table width="98%" border="0" cellpadding="3" cellspacing="1" bgcolor="#D1DDAA" align="center" class="table maintable table-bordered mt-3"> | <table width="98%" border="0" cellpadding="3" cellspacing="1" bgcolor="#D1DDAA" align="center" class="table maintable table-bordered mt-3"> | ||||
| @@ -24,19 +51,7 @@ | |||||
| <tr> | <tr> | ||||
| <td width="300" valign="top" bgcolor="#FFFFFF">选择标签:</td> | <td width="300" valign="top" bgcolor="#FFFFFF">选择标签:</td> | ||||
| <td width="377" valign="top" bgcolor="#FFFFFF"> | <td width="377" valign="top" bgcolor="#FFFFFF"> | ||||
| <?php | |||||
| $dd = $dsql->GetOne("SELECT ROUND(AVG(total)) as tt FROM `#@__tagindex`"); //取一个平均 | |||||
| $dd['tt'] = ($dd['tt'] > 5)? $dd['tt'] : 0; | |||||
| $sql="select * from #@__tagindex where total > {$dd['tt']} order by tag asc"; | |||||
| $dsql->Execute('al',$sql); | |||||
| echo "<select name='tagid' style='width:300px'>\r\n"; | |||||
| if($tid == 0) echo "<option value='0' selected='1'>更新所有标签</option>\r\n"; | |||||
| while($row=$dsql->GetObject('al')){ | |||||
| if($tid > 0 && $tid == $row->id) echo "<option value='".$row->id."' selected='1'>".$row->tag."</option>"; | |||||
| else echo "<option value='".$row->id."'>".$row->tag."</option>"; | |||||
| } | |||||
| echo "</select>"; | |||||
| ?> | |||||
| <select id='tagid' name='tagid' style='width:300px'> | |||||
| </td> | </td> | ||||
| </tr> | </tr> | ||||
| <tr> | <tr> | ||||
| @@ -46,7 +61,6 @@ | |||||
| <tr> | <tr> | ||||
| <td height="26" valign="top" bgcolor="#FFFFFF">说明:</td> | <td height="26" valign="top" bgcolor="#FFFFFF">说明:</td> | ||||
| <td height="26" valign="top" bgcolor="#FFFFFF"> | <td height="26" valign="top" bgcolor="#FFFFFF"> | ||||
| 仅更新文档数多于<?php echo $dd['tt'];?>的关键词<br> | |||||
| 更新所有Tag将会智能更新在[Tag标签管理]中重新获取更新的内容<br> | 更新所有Tag将会智能更新在[Tag标签管理]中重新获取更新的内容<br> | ||||
| Tag首页模板文件:<?php echo $cfg_templets_dir;?>/<?php echo $cfg_df_style?>/tag.htm<br> | Tag首页模板文件:<?php echo $cfg_templets_dir;?>/<?php echo $cfg_df_style?>/tag.htm<br> | ||||
| Tag列表页模板文件:<?php echo $cfg_templets_dir;?>/<?php echo $cfg_df_style?>/taglist.htm<br> | Tag列表页模板文件:<?php echo $cfg_templets_dir;?>/<?php echo $cfg_df_style?>/taglist.htm<br> | ||||
| @@ -113,7 +113,7 @@ | |||||
| <form name="form2" action="tags_main.php"> | <form name="form2" action="tags_main.php"> | ||||
| <span>搜索:<input type="text" name="tag" size="10" value="<?php echo $tag; ?>"></span> | <span>搜索:<input type="text" name="tag" size="10" value="<?php echo $tag; ?>"></span> | ||||
| <button type="submit" name="sb" class="btn btn-success btn-sm">确定</button> | <button type="submit" name="sb" class="btn btn-success btn-sm">确定</button> | ||||
| <a href="makehtml_taglist.php" name="sb" class="btn btn-success btn-sm">更新</a> | |||||
| <a href="makehtml_taglist.php" name="sb" class="btn btn-success btn-sm">生成标签</a> | |||||
| </form> | </form> | ||||
| </td> | </td> | ||||
| </tr> | </tr> | ||||
| @@ -146,7 +146,7 @@ | |||||
| <td> | <td> | ||||
| <a href='javascript:UpdateKwDes(<?php echo $fields['id']; ?>,"<?php echo $fields['tag']; ?>");' class="btn btn-success btn-sm">关键词描述</a> | <a href='javascript:UpdateKwDes(<?php echo $fields['id']; ?>,"<?php echo $fields['tag']; ?>");' class="btn btn-success btn-sm">关键词描述</a> | ||||
| <a href="javascript:UpdateOne(<?php echo $fields['id']; ?>);" class="btn btn-success btn-sm">更新</a> | <a href="javascript:UpdateOne(<?php echo $fields['id']; ?>);" class="btn btn-success btn-sm">更新</a> | ||||
| <a href="makehtml_taglist.php?tid=<?php echo $fields['id']; ?>" class="btn btn-success btn-sm">生成</a> | |||||
| <a href="makehtml_taglist.php?tagid=<?php echo $fields['id']; ?>" class="btn btn-success btn-sm">生成</a> | |||||
| <a href="javascript:DeleteOne(<?php echo $fields['id']; ?>);" class="btn btn-success btn-sm">删除</a> | <a href="javascript:DeleteOne(<?php echo $fields['id']; ?>);" class="btn btn-success btn-sm">删除</a> | ||||
| </td> | </td> | ||||
| </tr> | </tr> | ||||
| @@ -6,6 +6,7 @@ | |||||
| * @license https://www.dedebiz.com/license | * @license https://www.dedebiz.com/license | ||||
| * @link https://www.dedebiz.com | * @link https://www.dedebiz.com | ||||
| */ | */ | ||||
| require_once(dirname(__FILE__)."/../system/common.inc.php"); | require_once(dirname(__FILE__)."/../system/common.inc.php"); | ||||
| require_once(DEDEINC."/archive/taglist.class.php"); | require_once(DEDEINC."/archive/taglist.class.php"); | ||||
| $PageNo = 1; | $PageNo = 1; | ||||
| @@ -18,6 +19,7 @@ if (isset($_SERVER['QUERY_STRING'])) { | |||||
| } else { | } else { | ||||
| $tag = ''; | $tag = ''; | ||||
| } | } | ||||
| $tag = FilterSearch(urldecode($tag)); | $tag = FilterSearch(urldecode($tag)); | ||||
| if ($tag != addslashes($tag)) $tag = ''; | if ($tag != addslashes($tag)) $tag = ''; | ||||
| if ($tag == '') $dlist = new TagList($tag, 'tag.htm'); | if ($tag == '') $dlist = new TagList($tag, 'tag.htm'); | ||||
| @@ -0,0 +1,3 @@ | |||||
| /*! Select2 4.0.13 | https://github.com/select2/select2/blob/master/LICENSE.md */ | |||||
| !function(){if(jQuery&&jQuery.fn&&jQuery.fn.select2&&jQuery.fn.select2.amd)var n=jQuery.fn.select2.amd;n.define("select2/i18n/zh-CN",[],function(){return{errorLoading:function(){return"无法载入结果。"},inputTooLong:function(n){return"请删除"+(n.input.length-n.maximum)+"个字符"},inputTooShort:function(n){return"请再输入至少"+(n.minimum-n.input.length)+"个字符"},loadingMore:function(){return"载入更多结果…"},maximumSelected:function(n){return"最多只能选择"+n.maximum+"个项目"},noResults:function(){return"未找到结果"},searching:function(){return"搜索中…"},removeAllItems:function(){return"删除所有项目"}}}),n.define,n.require}(); | |||||
| @@ -172,9 +172,9 @@ class TagList | |||||
| if (file_exists($makeDir)) { | if (file_exists($makeDir)) { | ||||
| header('HTTP/1.1 301 Moved Permanently'); | header('HTTP/1.1 301 Moved Permanently'); | ||||
| if (!empty($this->Tag)) { | if (!empty($this->Tag)) { | ||||
| header('Location:a/tags/'.GetPinyin($this->Tag)."/"); | |||||
| header('Location:../a/tags/'.GetPinyin($this->Tag)."/"); | |||||
| } else { | } else { | ||||
| header('Location:a/tags/'); | |||||
| header('Location:../a/tags/'); | |||||
| } | } | ||||
| exit; | exit; | ||||
| } | } | ||||
| @@ -85,7 +85,7 @@ | |||||
| <!-- /.position --> | <!-- /.position --> | ||||
| </div> | </div> | ||||
| <main class="container"> | |||||
| <main class="container mb-2"> | |||||
| <div class="row"> | <div class="row"> | ||||
| <div class="col-md-12 list-main"> | <div class="col-md-12 list-main"> | ||||