| @@ -155,7 +155,7 @@ function GetFormItem($ctag) | |||||
| */ | */ | ||||
| function GetFieldValue($dvalue,$dtype,$aid=0,$job='add',$addvar='') | function GetFieldValue($dvalue,$dtype,$aid=0,$job='add',$addvar='') | ||||
| { | { | ||||
| global $cfg_cookie_encode,$cfg_dir_purview; | |||||
| global $cfg_cookie_encode,$cfg_dir_purview,$isUrlOpen; | |||||
| if($dtype=="int") | if($dtype=="int") | ||||
| { | { | ||||
| $dvalue = trim(preg_replace("#[^0-9]#", "", $dvalue)); | $dvalue = trim(preg_replace("#[^0-9]#", "", $dvalue)); | ||||
| @@ -242,7 +242,7 @@ function GetFieldValue($dvalue,$dtype,$aid=0,$job='add',$addvar='') | |||||
| $imgfile = $GLOBALS['cfg_basedir'].$iurl; | $imgfile = $GLOBALS['cfg_basedir'].$iurl; | ||||
| if(is_file($imgfile)) | if(is_file($imgfile)) | ||||
| { | { | ||||
| $imginfos = GetImageSize($imgfile,&$info); | |||||
| $imginfos = GetImageSize($imgfile); | |||||
| $imgurl = "{dede:img text='' width='".$imginfos[0]."' height='".$imginfos[1]."'} $iurl {/dede:img}"; | $imgurl = "{dede:img text='' width='".$imginfos[0]."' height='".$imginfos[1]."'} $iurl {/dede:img}"; | ||||
| } | } | ||||
| } | } | ||||
| @@ -9,6 +9,7 @@ | |||||
| * @link http://www.dedecms.com | * @link http://www.dedecms.com | ||||
| */ | */ | ||||
| require_once(dirname(__FILE__)."/config.php"); | require_once(dirname(__FILE__)."/config.php"); | ||||
| $tid = isset($tid)? $tid : 0; | |||||
| include DedeInclude('templets/makehtml_taglist.htm'); | include DedeInclude('templets/makehtml_taglist.htm'); | ||||
| ?> | ?> | ||||
| @@ -13,29 +13,39 @@ require_once(dirname(__FILE__) . "/config.php"); | |||||
| CheckPurview('sys_MakeHtml'); | CheckPurview('sys_MakeHtml'); | ||||
| require_once(DEDEINC . "/arc.taglist.class.php"); | require_once(DEDEINC . "/arc.taglist.class.php"); | ||||
| if (empty($total)) $total = 0; // TAGS总数 | |||||
| if (empty($pageno)) $pageno = 0; | if (empty($pageno)) $pageno = 0; | ||||
| if (empty($mkpage)) $mkpage = 1; | if (empty($mkpage)) $mkpage = 1; | ||||
| if (empty($offset)) $offset = 0; // 当前位置 | |||||
| if (empty($upall)) $upall = 0; // 是否更新全部 0为更新单个 1为更新全部 | |||||
| if (empty($ctagid)) $ctagid = 0; // 当前处理的tagid | |||||
| if (empty($maxpagesize)) $maxpagesize = 50; | if (empty($maxpagesize)) $maxpagesize = 50; | ||||
| $tagid = isset($tagid) ? intval($tagid) : 0; | $tagid = isset($tagid) ? intval($tagid) : 0; | ||||
| if ($total == 0 && $tagid == 0) { | |||||
| $total = $dsql->GetOne("SELECT count(*) as dd FROM `#@__tagindex`"); | |||||
| $total = intval($total['dd']); | |||||
| if ($tagid > 0) { | |||||
| $upall = 0; // 更新单个模式 | |||||
| $ctagid = $tagid; | |||||
| } else { | |||||
| $upall = 1; // 更新全部模式 | |||||
| } | } | ||||
| $allfinish = false; // 是否全部完成 | |||||
| $allfinish = false; | |||||
| if ($upall == 1 && $ctagid == 0) { | |||||
| $rr = $dsql->GetOne("SELECT * FROM `#@__tagindex` WHERE mktime <> uptime LIMIT 1"); | |||||
| if (!empty($rr) && count($rr) > 0) { | |||||
| $ctagid = $rr['id']; | |||||
| } else { | |||||
| $allfinish = true; | |||||
| if ($offset < ($total - 1)) { | |||||
| $tt = $dsql->GetOne("SELECT * FROM `#@__tagindex` LIMIT " . $offset . ",1;"); | |||||
| $tagid = $tt['id']; | |||||
| $offset++; | |||||
| } else { | |||||
| $allfinish = true; | |||||
| } | |||||
| } | } | ||||
| $tag = $dsql->GetOne("SELECT * FROM `#@__tagindex` WHERE id='$tagid' LIMIT 0,1;"); | |||||
| if ($ctagid == 0 && $allfinish) { | |||||
| $reurl = '../a/tags/'; | |||||
| ShowMsg("完成TAG更新!<a href='$reurl' target='_blank'>浏览TAG首页</a>", "javascript:;"); | |||||
| exit; | |||||
| } | |||||
| $tag = $dsql->GetOne("SELECT * FROM `#@__tagindex` WHERE id='$ctagid' LIMIT 0,1;"); | |||||
| MkdirAll($cfg_basedir . "/a/tags", $cfg_dir_purview); | MkdirAll($cfg_basedir . "/a/tags", $cfg_dir_purview); | ||||
| @@ -46,7 +56,7 @@ if (is_array($tag) && count($tag) > 0) { | |||||
| if ($ntotalpage <= $maxpagesize) { | if ($ntotalpage <= $maxpagesize) { | ||||
| $dlist->MakeHtml('', ''); | $dlist->MakeHtml('', ''); | ||||
| $finishType = TRUE; | |||||
| $finishType = TRUE; // 生成一个TAG完成 | |||||
| } else { | } else { | ||||
| $reurl = $dlist->MakeHtml($mkpage, $maxpagesize); | $reurl = $dlist->MakeHtml($mkpage, $maxpagesize); | ||||
| $finishType = FALSE; | $finishType = FALSE; | ||||
| @@ -55,27 +65,36 @@ if (is_array($tag) && count($tag) > 0) { | |||||
| } | } | ||||
| $nextpage = $pageno + 1; | $nextpage = $pageno + 1; | ||||
| if ($nextpage >= $ntotalpage && $finishType && !($offset < ($total - 1))) { | |||||
| $onefinish = $nextpage >= $ntotalpage && $finishType; | |||||
| if (($upall == 0 && $onefinish) || ($upall == 1 && $allfinish && $onefinish)) { | |||||
| $dlist = new TagList('', 'tag.htm'); | $dlist = new TagList('', 'tag.htm'); | ||||
| $dlist->MakeHtml(1, 10); | $dlist->MakeHtml(1, 10); | ||||
| $reurl = '../a/tags/'; | $reurl = '../a/tags/'; | ||||
| if ($total > 0) { | |||||
| if ($upall == 1) { | |||||
| ShowMsg("完成TAG更新!<a href='$reurl' target='_blank'>浏览TAG首页</a>", "javascript:;"); | ShowMsg("完成TAG更新!<a href='$reurl' target='_blank'>浏览TAG首页</a>", "javascript:;"); | ||||
| } else { | } else { | ||||
| $query = "UPDATE `#@__tagindex` SET mktime=uptime WHERE id='$ctagid' "; | |||||
| $dsql->ExecuteNoneQuery($query); | |||||
| $reurl .= GetPinyin($tag['tag']); | $reurl .= GetPinyin($tag['tag']); | ||||
| ShowMsg("完成TAG更新:[" . $tag['tag'] . "]!<a href='$reurl' target='_blank'>浏览TAG首页</a>", "javascript:;"); | ShowMsg("完成TAG更新:[" . $tag['tag'] . "]!<a href='$reurl' target='_blank'>浏览TAG首页</a>", "javascript:;"); | ||||
| } | } | ||||
| exit(); | exit(); | ||||
| } else { | } else { | ||||
| if ($finishType) { | if ($finishType) { | ||||
| if ($allfinish == true) { | |||||
| $total = 0; | |||||
| // 完成了一个跳到下一个 | |||||
| if ($upall == 1) { | |||||
| $query = "UPDATE `#@__tagindex` SET mktime=uptime WHERE id='$ctagid' "; | |||||
| $dsql->ExecuteNoneQuery($query); | |||||
| $ctagid = 0; | |||||
| $nextpage = 0; | |||||
| } | } | ||||
| $gourl = "makehtml_taglist_action.php?maxpagesize=$maxpagesize&tagid=$tagid&pageno=$nextpage&total=$total&offset=$offset"; | |||||
| $gourl = "makehtml_taglist_action.php?maxpagesize=$maxpagesize&tagid=$tagid&pageno=$nextpage&upall=$upall&ctagid=$ctagid"; | |||||
| ShowMsg("成功生成TAG:[" . $tag['tag'] . "],继续进行操作!", $gourl, 0, 100); | ShowMsg("成功生成TAG:[" . $tag['tag'] . "],继续进行操作!", $gourl, 0, 100); | ||||
| exit(); | exit(); | ||||
| } else { | } else { | ||||
| $gourl = "makehtml_taglist_action.php?mkpage=$mkpage&maxpagesize=$maxpagesize&tagid=$tagid&pageno=$pageno&total=$total&offset=$offset"; | |||||
| // 继续当前这个 | |||||
| $gourl = "makehtml_taglist_action.php?mkpage=$mkpage&maxpagesize=$maxpagesize&tagid=$tagid&pageno=$pageno&upall=$upall&ctagid=$ctagid"; | |||||
| ShowMsg("成功生成TAG:[" . $tag['tag'] . "],继续进行操作...", $gourl, 0, 100); | ShowMsg("成功生成TAG:[" . $tag['tag'] . "],继续进行操作...", $gourl, 0, 100); | ||||
| exit(); | exit(); | ||||
| } | } | ||||
| @@ -40,6 +40,7 @@ function update() | |||||
| else if($action == 'update') | else if($action == 'update') | ||||
| { | { | ||||
| $tid = (empty($tid) ? 0 : intval($tid) ); | $tid = (empty($tid) ? 0 : intval($tid) ); | ||||
| $count = (empty($count) ? 0 : intval($count) ); | |||||
| if(empty($tid)) | if(empty($tid)) | ||||
| { | { | ||||
| ShowMsg('没有选择要删除的tag!','-1'); | ShowMsg('没有选择要删除的tag!','-1'); | ||||
| @@ -91,7 +92,7 @@ else if($action == 'fetch') | |||||
| $where = array(); | $where = array(); | ||||
| if(isset($startaid) && is_numeric($startaid) && $startaid > 0) | if(isset($startaid) && is_numeric($startaid) && $startaid > 0) | ||||
| { | { | ||||
| $where[] = " id>$startaid "; | |||||
| $where[] = " id>=$startaid "; | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -99,7 +100,7 @@ else if($action == 'fetch') | |||||
| } | } | ||||
| if(isset($endaid) && is_numeric($endaid) && $endaid > 0) | if(isset($endaid) && is_numeric($endaid) && $endaid > 0) | ||||
| { | { | ||||
| $where[] = " id<$endaid "; | |||||
| $where[] = " id<=$endaid "; | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -113,6 +114,7 @@ else if($action == 'fetch') | |||||
| $dsql->SetQuery($query); | $dsql->SetQuery($query); | ||||
| $dsql->Execute(); | $dsql->Execute(); | ||||
| $complete = true; | $complete = true; | ||||
| $now = time(); | |||||
| while($row = $dsql->GetArray()) | while($row = $dsql->GetArray()) | ||||
| { | { | ||||
| $aid = $row['aid']; | $aid = $row['aid']; | ||||
| @@ -133,16 +135,20 @@ else if($action == 'fetch') | |||||
| if($keyword != '' && strlen($keyword)<13 ) | if($keyword != '' && strlen($keyword)<13 ) | ||||
| { | { | ||||
| $keyword = addslashes($keyword); | $keyword = addslashes($keyword); | ||||
| $row = $dsql->GetOne("SELECT id FROM `#@__tagindex` WHERE tag LIKE '$keyword'"); | |||||
| $row = $dsql->GetOne("SELECT id,total FROM `#@__tagindex` WHERE tag LIKE '$keyword'"); | |||||
| if(is_array($row)) | if(is_array($row)) | ||||
| { | { | ||||
| $tid = $row['id']; | $tid = $row['id']; | ||||
| $query = "UPDATE `#@__tagindex` SET `total`=`total`+1 WHERE id='$tid' "; | |||||
| $dsql->ExecuteNoneQuery($query); | |||||
| $trow = $dsql->GetOne("SELECT COUNT(*) as dd FROM `#@__taglist` WHERE tag LIKE '$keyword'"); | |||||
| if (intval($trow['dd']) != $row['total'] ) { | |||||
| $query = "UPDATE `#@__tagindex` SET `total`=".$trow['dd'].",uptime=$now WHERE id='$tid' "; | |||||
| $dsql->ExecuteNoneQuery($query); | |||||
| } | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| $query = " INSERT INTO `#@__tagindex`(`tag`,`count`,`total`,`weekcc`,`monthcc`,`weekup`,`monthup`,`addtime`) VALUES('$keyword','0','1','0','0','$timestamp','$timestamp','$timestamp');"; | |||||
| $query = " INSERT INTO `#@__tagindex`(`tag`,`count`,`total`,`weekcc`,`monthcc`,`weekup`,`monthup`,`addtime`,`uptime`) VALUES('$keyword','0','1','0','0','$timestamp','$timestamp','$timestamp','$now');"; | |||||
| $dsql->ExecuteNoneQuery($query); | $dsql->ExecuteNoneQuery($query); | ||||
| $tid = $dsql->GetLastID(); | $tid = $dsql->GetLastID(); | ||||
| } | } | ||||
| @@ -15,6 +15,7 @@ | |||||
| <tr> | <tr> | ||||
| <td width="30%" height="18"><strong>更新TAG HTML</strong> </td> | <td width="30%" height="18"><strong>更新TAG HTML</strong> </td> | ||||
| <td width="70%" align="right"> | <td width="70%" align="right"> | ||||
| <a href="tags_main.php" class="coolbg np">TAG标签管理</a> | |||||
| </td> | </td> | ||||
| </tr> | </tr> | ||||
| </table> | </table> | ||||
| @@ -26,10 +27,12 @@ | |||||
| <?php | <?php | ||||
| $sql="select * from #@__tagindex order by tag asc"; | $sql="select * from #@__tagindex order by tag asc"; | ||||
| $dsql->Execute('al',$sql); | $dsql->Execute('al',$sql); | ||||
| echo "<select name='tagid' style='width:300px'>\r\n"; | |||||
| echo "<option value='0' selected='1'>更新所有TAG...</option>\r\n"; | |||||
| while($row=$dsql->GetObject('al')){ | |||||
| echo "<option value='".$row->id."'>".$row->tag."</option>"; | |||||
| echo "<select name='tagid' style='width:300px'>\r\n"; | |||||
| if($tid == 0) echo "<option value='0' selected='1'>更新所有TAG...</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>"; | echo "</select>"; | ||||
| ?> | ?> | ||||
| @@ -43,14 +46,16 @@ | |||||
| </tr> | </tr> | ||||
| <tr> | <tr> | ||||
| <td height="20" valign="top" bgcolor="#FFFFFF">说明:</td> | <td height="20" valign="top" bgcolor="#FFFFFF">说明:</td> | ||||
| <td height="20" valign="top" bgcolor="#FFFFFF"> | |||||
| * 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> | |||||
| <td height="20" valign="top" bgcolor="#FFFFFF"> | |||||
| 更新所有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?>/taglist.htm<br> | |||||
| 生成静态文件后,访问动态文件则直接跳转到静态文件,如果需要动态访问,删除对应文件即可。 | 生成静态文件后,访问动态文件则直接跳转到静态文件,如果需要动态访问,删除对应文件即可。 | ||||
| </td> | </td> | ||||
| </tr> | </tr> | ||||
| <tr> | <tr> | ||||
| <td height="20" colspan="2" bgcolor="#FAFAF1" align="center"> | <td height="20" colspan="2" bgcolor="#FAFAF1" align="center"> | ||||
| <input name="b112" type="button" class="coolbg np" value="生成TAG HTML" | <input name="b112" type="button" class="coolbg np" value="生成TAG HTML" | ||||
| onClick="document.form1.action='makehtml_taglist_action.php';document.form1.submit();" style="width:120px"> | onClick="document.form1.action='makehtml_taglist_action.php';document.form1.submit();" style="width:120px"> | ||||
| </td> | </td> | ||||
| @@ -1,127 +1,147 @@ | |||||
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |||||
| <!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"> | <html xmlns="http://www.w3.org/1999/xhtml"> | ||||
| <head> | <head> | ||||
| <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>"> | |||||
| <title>tags管理</title> | |||||
| <link href="css/base.css" rel="stylesheet" type="text/css" /> | |||||
| <script language="javascript"> | |||||
| function checkall(form, prefix, checkall) | |||||
| { | |||||
| var checkall = checkall ? checkall : 'all'; | |||||
| for(var i = 0; i < form.elements.length; i++) | |||||
| { | |||||
| var e = form.elements[i]; | |||||
| if(e.name && e.name != checkall && (!prefix || (prefix && e.name.match(prefix)))) | |||||
| { | |||||
| e.checked = form.elements[checkall].checked; | |||||
| <meta http-equiv="Content-Type" content="text/html; charset=<?php echo $cfg_soft_lang; ?>"> | |||||
| <title>tags管理</title> | |||||
| <link href="css/base.css" rel="stylesheet" type="text/css" /> | |||||
| <script language="javascript"> | |||||
| function checkall(form, prefix, checkall) { | |||||
| var checkall = checkall ? checkall : 'all'; | |||||
| for (var i = 0; i < form.elements.length; i++) { | |||||
| var e = form.elements[i]; | |||||
| if (e.name && e.name != checkall && (!prefix || (prefix && e.name.match(prefix)))) { | |||||
| e.checked = form.elements[checkall].checked; | |||||
| } | |||||
| } | |||||
| } | } | ||||
| } | |||||
| } | |||||
| function UpdateOne(tid) | |||||
| { | |||||
| location = "tags_main.php?action=update&count="+document.getElementById('count'+tid).value+"&tid="+tid; | |||||
| } | |||||
| function DeleteOne(tid) | |||||
| { | |||||
| location = "tags_main.php?action=delete&ids="+tid; | |||||
| } | |||||
| </script> | |||||
| function UpdateOne(tid) { | |||||
| location = "tags_main.php?action=update&count=" + document.getElementById('count' + tid).value + "&tid=" + tid; | |||||
| } | |||||
| function DeleteOne(tid) { | |||||
| location = "tags_main.php?action=delete&ids=" + tid; | |||||
| } | |||||
| </script> | |||||
| </head> | </head> | ||||
| <body> | <body> | ||||
| <div class="bodytitle"> | |||||
| <div class="bodytitleleft"></div> | |||||
| <div class="bodytitletxt" style="padding-left:10px;">Tags标签管理</div> | |||||
| </div> | |||||
| <div class="main"> | |||||
| <form name='form1' action="tags_main.php?action=fetch" method="post" style="margin-bottom:6px;"> | |||||
| <table width="98%" border="0" cellspacing="1" align="center" class="tbtitle" style="background:#CFCFCF;"> | |||||
| <tr> | |||||
| <td height="20" align="left" bgcolor="#F0FBBD" background="images/wbg.gif" style="padding-left:10px;"><strong>提取TAG</strong></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td height="30" align="center" bgcolor="#Ffffff"> | |||||
| 开始id: | |||||
| <input type="text" name="startaid" /> | |||||
| 结束id: | |||||
| <input type="text" name="endaid" /> | |||||
| | |||||
| <input name="submit" type="submit" value="获取tags" class="np coolbg" /> | |||||
| <small>(tag以文档关键词为准)</small> | |||||
| </td> | |||||
| </tr> | |||||
| </table> | |||||
| </form> | |||||
| <table width="98%" border="0" cellpadding="1" cellspacing="1" align="center" class="tbtitle" style="background:#CFCFCF;"> | |||||
| <tr> | |||||
| <td height="20" colspan="6" bgcolor="#F0FBBD" background="images/wbg.gif"> | |||||
| <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> | |||||
| <tr> | |||||
| <td align="left" style="padding-left:10px;"><strong>TAG维护</strong></td> | |||||
| <form name='form2' action="tags_main.php"> | |||||
| <td width="40%" align="right"> | |||||
| 搜索: | |||||
| <input type='text' name='tag' size='10' value="<?php echo $tag;?>"> | |||||
| <input type='submit' name='sb' value='确定' class="np coolbg" /> | |||||
| </td> | |||||
| </form> | |||||
| </tr> | |||||
| </table></td> | |||||
| </tr> | |||||
| <tr align="center" bgcolor="#FBFCE2" height="26"> | |||||
| <td width="5%">删</td> | |||||
| <td width="30%">标签</td> | |||||
| <td width="15%"><a href="tags_main.php?tag=<?php echo $tag;?>&orderby=count&orderway=<?php echo $neworderway;?>"><u>点击</u></a></td> | |||||
| <td width="15%"><a href="tags_main.php?tag=<?php echo $tag;?>&orderby=total&orderway=<?php echo $neworderway;?>"><u>文档数</u></a></td> | |||||
| <td width="20%"><a href="tags_main.php?tag=<?php echo $tag;?>&orderby=addtime&orderway=<?php echo $neworderway;?>"><u>添加时间</u></a></td> | |||||
| <td></td> | |||||
| </tr> | |||||
| <form name='form3' action="tags_main.php?action=delete" method="post"> | |||||
| {dede:datalist} | |||||
| <?php | |||||
| <div class="bodytitle"> | |||||
| <div class="bodytitleleft"></div> | |||||
| <div class="bodytitletxt" style="padding-left:10px;"><a href="tags_main.php">Tags标签管理</a></div> | |||||
| </div> | |||||
| <div class="main"> | |||||
| <form name='form1' action="tags_main.php?action=fetch" method="post" style="margin-bottom:6px;"> | |||||
| <table width="98%" border="0" cellspacing="1" align="center" class="tbtitle" style="background:#CFCFCF;"> | |||||
| <tr> | |||||
| <td height="20" align="left" bgcolor="#F0FBBD" background="images/wbg.gif" | |||||
| style="padding-left:10px;"><strong>提取TAG</strong></td> | |||||
| </tr> | |||||
| <tr> | |||||
| <td height="30" align="center" bgcolor="#Ffffff"> | |||||
| 开始id: | |||||
| <input type="text" name="startaid" /> | |||||
| 结束id: | |||||
| <input type="text" name="endaid" /> | |||||
| | |||||
| <input name="submit" type="submit" value="获取tags" class="np coolbg" /> | |||||
| <small>(tag以文档关键词为准)</small> | |||||
| </td> | |||||
| </tr> | |||||
| </table> | |||||
| </form> | |||||
| <table width="98%" border="0" cellpadding="1" cellspacing="1" align="center" class="tbtitle" | |||||
| style="background:#CFCFCF;"> | |||||
| <tr> | |||||
| <td height="20" colspan="7" bgcolor="#F0FBBD" background="images/wbg.gif"> | |||||
| <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> | |||||
| <tr> | |||||
| <td align="left" style="padding-left:10px;"><strong>TAG维护</strong></td> | |||||
| <form name='form2' action="tags_main.php"> | |||||
| <td width="40%" align="right"> | |||||
| 搜索: | |||||
| <input type='text' name='tag' size='10' value="<?php echo $tag;?>"> | |||||
| <input type='submit' name='sb' value='确定' class="np coolbg" /> | |||||
| <a href="makehtml_taglist.php" name='sb' class="np coolbg">更新TAG HTML</a> | |||||
| </td> | |||||
| </form> | |||||
| </tr> | |||||
| </table> | |||||
| </td> | |||||
| </tr> | |||||
| <tr align="center" bgcolor="#FBFCE2" height="26"> | |||||
| <td width="5%">删</td> | |||||
| <td width="30%">标签</td> | |||||
| <td width="10%"><a | |||||
| href="tags_main.php?tag=<?php echo $tag;?>&orderby=count&orderway=<?php echo $neworderway;?>"><u>点击</u></a> | |||||
| </td> | |||||
| <td width="10%"><a | |||||
| href="tags_main.php?tag=<?php echo $tag;?>&orderby=total&orderway=<?php echo $neworderway;?>"><u>文档数</u></a> | |||||
| </td> | |||||
| <td width="15%"><a | |||||
| href="tags_main.php?tag=<?php echo $tag;?>&orderby=addtime&orderway=<?php echo $neworderway;?>"><u>添加时间</u></a> | |||||
| </td> | |||||
| <td width="15%">更新时间</td> | |||||
| <td width="20%">操作</td> | |||||
| </tr> | |||||
| <form name='form3' action="tags_main.php?action=delete" method="post"> | |||||
| {dede:datalist} | |||||
| <?php | |||||
| $fields['addtime'] = GetDateMk($fields['addtime']); | $fields['addtime'] = GetDateMk($fields['addtime']); | ||||
| $fields['uptime'] = GetDateMk($fields['uptime']); | |||||
| $fields['tag'] = dede_htmlspecialchars($fields['tag']); | $fields['tag'] = dede_htmlspecialchars($fields['tag']); | ||||
| ?> | ?> | ||||
| <tr align="center" bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';"> | |||||
| <td height="24"> | |||||
| <input type="checkbox" name="ids[]" value="<?php echo $fields['id']; ?>" class='np' /> | |||||
| </td> | |||||
| <td> | |||||
| <a href="../tags.php?/<?php echo urlencode($fields['tag']); ?>/" target="_blank">{dede:field.tag /}</a> | |||||
| </td> | |||||
| <td> | |||||
| <input type='text' value='<?php echo $fields['count']; ?>' id='count<?php echo $fields['id']; ?>' size='5' /> | |||||
| </td> | |||||
| <td> | |||||
| <?php echo $fields['total']; ?> | |||||
| </td> | |||||
| <td> | |||||
| <?php echo $fields['addtime']; ?> | |||||
| </td> | |||||
| <td> | |||||
| <a href='javascript:UpdateOne(<?php echo $fields['id']; ?>);'>[更新]</a> | |||||
| | |||||
| <a href='javascript:DeleteOne(<?php echo $fields['id']; ?>);'>[删]</a> | |||||
| </td> | |||||
| </tr> | |||||
| {/dede:datalist} | |||||
| <tr bgcolor="#F0FBBD"> | |||||
| <td align="center" bgcolor="#F8FEE0" height="28"> | |||||
| <label> | |||||
| <input type="checkbox" onclick="checkall(this.form, 'ids')" name="all" class="np" /> | |||||
| <br />全选 | |||||
| </label> | |||||
| </td> | |||||
| <td height="28" colspan="5" align="center" bgcolor="#F8FEE0" > | |||||
| {dede:pagelist /} | |||||
| </td> | |||||
| </tr> | |||||
| </form> | |||||
| <tr align="center" bgcolor="#FAFDF0"> | |||||
| <td height="40" colspan="6"> | |||||
| <input type='button' onclick="document.form3.submit()" class="np coolbg" value='删除所选' /> | |||||
| </td> | |||||
| </tr> | |||||
| </table> | |||||
| </div> | |||||
| <tr align="center" bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" | |||||
| onMouseOut="javascript:this.bgColor='#FFFFFF';"> | |||||
| <td height="24"> | |||||
| <input type="checkbox" name="ids[]" value="<?php echo $fields['id']; ?>" class='np' /> | |||||
| </td> | |||||
| <td> | |||||
| <a href="../tags.php?/<?php echo urlencode($fields['tag']); ?>/" target="_blank">{dede:field.tag | |||||
| /}</a> | |||||
| </td> | |||||
| <td> | |||||
| <input type='text' value='<?php echo $fields['count']; ?>' | |||||
| id='count<?php echo $fields['id']; ?>' size='5' /> | |||||
| </td> | |||||
| <td> | |||||
| <?php echo $fields['total']; ?> | |||||
| </td> | |||||
| <td> | |||||
| <?php echo $fields['addtime']; ?> | |||||
| </td> | |||||
| <td> | |||||
| <?php echo $fields['uptime']; ?> | |||||
| </td> | |||||
| <td> | |||||
| <a href='javascript:UpdateOne(<?php echo $fields['id']; ?>);'>[更新]</a> | |||||
| <a href='makehtml_taglist.php?tid=<?php echo $fields['id'];?>'>[生成HTML]</a> | |||||
| <a href='javascript:DeleteOne(<?php echo $fields['id']; ?>);'>[删]</a> | |||||
| </td> | |||||
| </tr> | |||||
| {/dede:datalist} | |||||
| <tr bgcolor="#F0FBBD"> | |||||
| <td align="center" bgcolor="#F8FEE0" height="28"> | |||||
| <label> | |||||
| <input type="checkbox" onclick="checkall(this.form, 'ids')" name="all" class="np" /> | |||||
| <br />全选 | |||||
| </label> | |||||
| </td> | |||||
| <td height="28" colspan="7" align="center" bgcolor="#F8FEE0"> | |||||
| {dede:pagelist /} | |||||
| </td> | |||||
| </tr> | |||||
| </form> | |||||
| <tr align="center" bgcolor="#FAFDF0"> | |||||
| <td height="40" colspan="8"> | |||||
| <input type='button' onclick="document.form3.submit()" class="np coolbg" value='删除所选' /> | |||||
| </td> | |||||
| </tr> | |||||
| </table> | |||||
| </div> | |||||
| </body> | </body> | ||||
| </html> | </html> | ||||
| @@ -90,7 +90,7 @@ function dede_random_bytes($length) | |||||
| } | } | ||||
| if (is_readable('/dev/urandom') && ($fp = fopen('/dev/urandom', 'rb')) !== FALSE) | if (is_readable('/dev/urandom') && ($fp = fopen('/dev/urandom', 'rb')) !== FALSE) | ||||
| { | { | ||||
| is_php('5.4') && stream_set_chunk_size($fp, $length); | |||||
| version_compare(PHP_VERSION, '5.4.0', '>=') && stream_set_chunk_size($fp, $length); | |||||
| $output = fread($fp, $length); | $output = fread($fp, $length); | ||||
| fclose($fp); | fclose($fp); | ||||
| if ($output !== FALSE) | if ($output !== FALSE) | ||||
| @@ -1146,6 +1146,8 @@ CREATE TABLE `#@__tagindex` ( | |||||
| `weekup` int(10) unsigned NOT NULL default '0', | `weekup` int(10) unsigned NOT NULL default '0', | ||||
| `monthup` int(10) unsigned NOT NULL default '0', | `monthup` int(10) unsigned NOT NULL default '0', | ||||
| `addtime` int(10) unsigned NOT NULL default '0', | `addtime` int(10) unsigned NOT NULL default '0', | ||||
| `uptime` INT(10) UNSIGNED NOT NULL DEFAULT '0', | |||||
| `mktime` INT(10) UNSIGNED NOT NULL DEFAULT '0', | |||||
| PRIMARY KEY (`id`) | PRIMARY KEY (`id`) | ||||
| ) TYPE=MyISAM; | ) TYPE=MyISAM; | ||||
| @@ -0,0 +1,3 @@ | |||||
| ALTER TABLE `#@__tagindex` | |||||
| ADD COLUMN `uptime` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `addtime`, | |||||
| ADD COLUMN `mktime` INT(10) UNSIGNED NOT NULL DEFAULT '0' AFTER `uptime`; | |||||
| @@ -67,7 +67,7 @@ function echo_validate_image( $config = array() ) | |||||
| $font_size = isset($config['font_size']) ? $config['font_size'] : 14; | $font_size = isset($config['font_size']) ? $config['font_size'] : 14; | ||||
| $img_height = isset($config['img_height']) ? $config['img_height'] : 24; | $img_height = isset($config['img_height']) ? $config['img_height'] : 24; | ||||
| $img_width = isset($config['img_width']) ? $config['img_width'] : 68; | $img_width = isset($config['img_width']) ? $config['img_width'] : 68; | ||||
| $font_file = isset($config['font_file']) ? $config['font_file'] : PATH_DATA.'/data/font/'.mt_rand(1,3).'.ttf'; | |||||
| $font_file = isset($config['font_file']) ? $config['font_file'] : DEDEINC.'/data/font/'.mt_rand(1,3).'.ttf'; | |||||
| $use_boder = isset($config['use_boder']) ? $config['use_boder'] : TRUE; | $use_boder = isset($config['use_boder']) ? $config['use_boder'] : TRUE; | ||||
| $filter_type = isset($config['filter_type']) ? $config['filter_type'] : 0; | $filter_type = isset($config['filter_type']) ? $config['filter_type'] : 0; | ||||