Browse Source

调整更新TAG

tags/6.1.8
tianya 1 year ago
parent
commit
d73b1faa3d
3 changed files with 26 additions and 146 deletions
  1. +12
    -8
      src/admin/makehtml_taglist_action.php
  2. +14
    -32
      src/admin/templets/makehtml_taglist.htm
  3. +0
    -106
      src/admin/templets/makeremote_all.htm

+ 12
- 8
src/admin/makehtml_taglist_action.php View File

@@ -13,10 +13,13 @@ CheckPurview('sys_MakeHtml');
require_once(DEDEINC."/archive/taglist.class.php");

if (empty($pageno)) $pageno = 0;
if (empty($mktime)) $mktime = time();
if (empty($mkpage)) $mkpage = 1;
if (empty($upall)) $upall = 0; //是否更新全部 0为更新单个 1为更新全部
if (empty($ctagid)) $ctagid = 0; //当前处理的tagid
if (empty($maxpagesize)) $maxpagesize = 50;
$startid = isset($startid) ? intval($startid) : 0;
$endid = isset($endid) ? intval($endid) : 0;
$tagid = isset($tagid) ? intval($tagid) : 0;
$tagsdir = str_replace("{cmspath}", $cfg_cmspath, $cfg_tags_dir);
// 生成
@@ -27,10 +30,12 @@ if ($tagid > 0) {
$upall = 1; //更新全部模式
}
$allfinish = false; //是否全部完成
$gwhere = ($startid == 0 ? "WHERE 1=1" : "WHERE id>=$startid");
if ($endid > $startid && $startid > 0) $gwhere .= " AND id <= $endid ";
// 判断生成模式
if ($upall == 1 && $ctagid == 0) {
$rr = $dsql->GetOne("SELECT * FROM `#@__tagindex` WHERE mktime <> uptime OR mktime = 0 LIMIT 1");
if (!empty($rr) && count($rr) > 0) {
$rr = $dsql->GetOne("SELECT * FROM `#@__tagindex` $gwhere AND mktime <> {$mktime} LIMIT 1");
if (isset($rr['id']) && $rr['id'] > 0) {
$ctagid = $rr['id'];
} else {
$allfinish = true;
@@ -83,20 +88,19 @@ if (is_array($tag) && count($tag) > 0) {
if ($finishType) {
//完成了一个跳到下一个
if ($upall == 1) {
$now = time();
$query = "UPDATE `#@__tagindex` SET uptime={$now} WHERE id='$ctagid' ";
$dsql->ExecuteNoneQuery($query);
$query = "UPDATE `#@__tagindex` SET mktime=uptime WHERE id='$ctagid' ";
$query = "UPDATE `#@__tagindex` SET mktime={$mktime} WHERE id='$ctagid' ";
$dsql->ExecuteNoneQuery($query);
$ctagid = 0;
$nextpage = 0;
}
$gourl = "makehtml_taglist_action.php?maxpagesize=$maxpagesize&tagid=$tagid&pageno=$nextpage&upall=$upall&ctagid=$ctagid";
$gourl = "makehtml_taglist_action.php?maxpagesize=$maxpagesize&tagid=$tagid&pageno=$nextpage&upall=$upall&ctagid=$ctagid&startid=$startid&endid=$endid&mktime=$mktime";
var_dump_cli($gourl);
ShowMsg("成功生成TAG:[".$tag['tag']."],继续进行操作", $gourl, 0, 100);
exit();
} else {
//继续当前这个
$gourl = "makehtml_taglist_action.php?mkpage=$mkpage&maxpagesize=$maxpagesize&tagid=$tagid&pageno=$pageno&upall=$upall&ctagid=$ctagid";
$gourl = "makehtml_taglist_action.php?mkpage=$mkpage&maxpagesize=$maxpagesize&tagid=$tagid&pageno=$pageno&upall=$upall&ctagid=$ctagid&startid=$startid&endid=$endid&mktime=$mktime";
var_dump_cli($gourl);
ShowMsg("成功生成TAG:[".$tag['tag']."],继续进行操作", $gourl, 0, 100);
exit();
}


+ 14
- 32
src/admin/templets/makehtml_taglist.htm View File

@@ -10,29 +10,9 @@
<script language="javascript" src="../static/web/js/select2.full.min.js"></script>
<script language="javascript" src="../static/web/js/i18n/zh-CN.js"></script>
<script>
$(function(){
$('#tagid').select2({
language: "zh-CN",
allowClear: true,
placeholder:"请输入一个标签",
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
};
}
}
});
});
function onTagSubmit() {
document.form1.submit();
}
</script>
</head>
<body>
@@ -55,7 +35,7 @@
$row = $dsql->GetOne("Select tag From `#@__tagindex` where id = '$tagid' ");
?>
<tr>
<td width="300" bgcolor="#ffffff">输入标签:</td>
<td width="200" bgcolor="#ffffff">输入标签:</td>
<td width="380" bgcolor="#ffffff">
<input type="hidden" name="tagid" value="<?php echo $tagid;?>"><?php echo $row['tag'];?> <a class="text-success" href="makehtml_taglist.php">重新选择</a>
</td>
@@ -64,24 +44,26 @@
} else {
?>
<tr>
<td width="300" bgcolor="#ffffff">输入标签:</td>
<td width="380" bgcolor="#ffffff">
<select id='tagid' name='tagid' style='width:260px'></select>
</td>
<td width="200" height="26" bgcolor="#ffffff">起始ID:</td>
<td height="26" bgcolor="#ffffff"><input name="startid" type="text" id="startid" style="width:60px">(空或0表示从头开始)</td>
</tr>
<tr>
<td width="200" height="26" bgcolor="#ffffff">结束ID:</td>
<td height="26" bgcolor="#ffffff"><input name="endid" type="text" id="endid" style="width:60px">(空或0表示直到结束ID)</td>
</tr>
<?php
}
?>
<tr>
<td height="26" bgcolor="#ffffff">生成位置:</td>
<td width="200" height="26" bgcolor="#ffffff">生成位置:</td>
<td height="26" bgcolor="#ffffff"><input name="tagsdir" type="text" id="tagsdir" value="<?php echo $cfg_tags_dir;?>" style="width:260px" disabled> <a href="sys_info.php">系统设置</a>-其他选项中“TAGS生成目录”项进行调整</td>
</tr>
<tr>
<td height="26" bgcolor="#ffffff">每次最大创建页数:</td>
<td width="200" height="26" bgcolor="#ffffff">每次最大创建页数:</td>
<td height="26" bgcolor="#ffffff"><input name="maxpagesize" type="text" id="maxpagesize" value="50" style="width:60px"> 个文件</td>
</tr>
<tr>
<td height="26" bgcolor="#ffffff">标签说明:</td>
<td width="200" height="26" bgcolor="#ffffff">标签说明:</td>
<td height="26" bgcolor="#ffffff">
生成静态文件后,访问动态文件则直接跳转到静态文件,如果需要动态访问,删除对应文件即可<br>
Tag首页模板文件:<?php echo $cfg_templets_dir; ?>/<?php echo $cfg_df_style?>/tag.htm<br>
@@ -90,7 +72,7 @@
</tr>
<tr>
<td height="26" colspan="2" bgcolor="#FAFAF1" align="center">
<button name="b112" type="button" class="btn btn-success btn-sm" onClick="document.form1.action='makehtml_taglist_action.php';document.form1.submit();">生成标签</button>
<button name="b112" type="button" class="btn btn-success btn-sm" onClick="document.form1.action='makehtml_taglist_action.php';onTagSubmit();">生成标签</button>
</td>
</tr>
</form>


+ 0
- 106
src/admin/templets/makeremote_all.htm View File

@@ -1,106 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>">
<title>远程服务器同步</title>
<link rel="stylesheet" href="../static/web/css/admin.css">
<link rel="stylesheet" media="all" href="../static/web/js/calendar/calendar-win2k-1.css" title="win2k-1">
<script type="text/javascript" src="../static/web/js/calendar/calendar.js"></script>
<script type="text/javascript" src="../static/web/js/calendar/calendar-cn.js"></script>
<script language="javascript">
function checkAll()
{
for(i=0;i<document.form2.Iterm.length;i++)
{
if(!document.form2.Iterm[i].checked)
{
document.form2.Iterm[i].checked=true;
} else {
document.form2.Iterm[i].checked=false;
}
}
}
function changeDopost(postval)
{
document.form2.maketype.value = postval;
document.form2.submit;
}
</script>
</head>
<body>
<table width="98%" border="0" cellpadding="3" cellspacing="1" align="center">
<form action="makeremote_all.php" method="post" name="form2" target="stafrm" id="form2">
<input type="hidden" name="dopost" value="make">
<input type="hidden" name="maketype" value="">
<tr>
<td height="26" colspan="5" background="../static/web/img/tbg.gif">
<table width="98%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="30%" height="18">远程服务器同步向导:</td>
<td width="70%" align="right"><a href="makeremote_all.php?dopost=updateremote">&nbsp;[更新同步目录]</a></td>
</tr>
</table>
</td>
</tr>
<tr>
<td width="61" bgcolor="#ffffff">
<label><input type="checkbox" name="remoteiterm" id="remoteiterm" onChange="javascript:checkAll()"></label>&nbsp;选择
</td>
<td width="185" align="center" bgcolor="#ffffff">项目(站点根目录)</td>
<td width="265" align="center" bgcolor="#ffffff">项目说明</td>
<td width="195" align="center" bgcolor="#ffffff">选择服务器</td>
<td width="196" align="center" bgcolor="#ffffff">状态</td>
</tr>
<?php
foreach($remotefile as $key => $value)
{
$bgcolor = ($key % 2 == 0)? '#E6F3CD' : '#ffffff';
?>
<tr>
<td width="60" align="center" bgcolor="<?php echo $bgcolor; ?>"><input name="Iterm[<?php echo $key; ?>]" type="checkbox" id="Iterm" value="<?php echo $value['filedir'] ; ?>"></td>
<td width="185" align="left" bgcolor="<?php echo $bgcolor; ?>"><?php echo $value['filedir'] ; ?><?php echo ($value['issystem']==1)? '<span style='color:#dc3545'>[系统]</span>' : '' ; ?></td>
<td width="260" bgcolor="<?php echo $bgcolor; ?>"><?php echo $value['description'] ; ?></td>
<td width="190" align="center" bgcolor="<?php echo $bgcolor; ?>"><label></label></td>
<td width="190" align="center" bgcolor="<?php echo $bgcolor; ?>"><?php echo GetState($value['state']) ; ?></td>
</tr>
<?php
}
?>
<tr>
<td height="30" colspan="5" bgcolor="#FAFAF1" align="left">功能说明:本功能主要用于本地服务器文件同远程服务器进行同步,这里我们有几个是系统文件夹(Html生成、文件上传、专题)是必须要同远程服务器同步的,当然也有可选文件夹,用户可以在系统根目录\data\config.file.inc.php文件中进行修改(修改方法已在文件中说明)</td>
</tr>
<tr>
<td height="30" colspan="5" bgcolor="#FAFAF1" align="center">
<input type="submit" class='coolbg np' name="Submit2" value="更新选择">&nbsp;
<input type="submit" class='coolbg np' name="Submit" value="同步更新所有" onClick="changeDopost('makeall')">
</td>
</tr>
</form>
<tr bgcolor="#E6F3CD">
<td height="26" colspan="5"><table width="100%">
<tr>
<td width="70%">进行状态:</td>
<td width="30%" align="right">
<script language='javascript'>
function ResizeDiv(obj,ty) {
if(ty=="+") document.all[obj].style.pixelHeight += 50;
else if(document.all[obj].style.pixelHeight>80) document.all[obj].style.pixelHeight = document.all[obj].style.pixelHeight - 50;
}
</script>
<a href="javascript:;" onClick="ResizeDiv('mdv','+');" class="btn btn-success btn-sm">增大</a>
<a href="javascript:;" onClick="ResizeDiv('mdv','-');" class="btn btn-success btn-sm">缩小</a>
</td>
</tr>
</table>
</td>
</tr>
<tr bgcolor="#ffffff">
<td colspan="5" id="mtd">
<div id="mdv" style="width:100%;height:300px">
<iframe name="stafrm" frameborder="0" id="stafrm" width="100%" height="100%"></iframe>
</div>
</td>
</tr>
</table>
</body>
</html>

Loading…
Cancel
Save