<?php
require_once "../includes/common.inc.php";
require_once MODEPATH.'./'.$adminpath.'/global.func.php';
require_once MODEPATH.'./includes/cache.func.php';
if(!$mm_mid){	
	clearcookies();
	header("Location:loggin.php?action=loggin");
	mexit();
}
if(!$adminid){	
	cpmsg('admin_login_failure','loggin.php?action=loggin');
	mexit();
}
if($id){
$db -> query("delete from {$tablepre}tags where id='$id'");
mexit('删除成功<script LANGUAGE="JavaScript">javascript:location="?";</script>');
}
  $sql = "WHERE result=1";
  $sql = "";
	$page = ispage($page) ? $page : 1;
	$pagenum = 500;
	$start_limit = ($page-1) * $pagenum;	
	$tagss = array();
	$query = $db -> query("SELECT COUNT(*) FROM {$tablepre}tags $sql");
	$lines = $db -> result($query, 0);
	$paging = paging($lines, $pagenum, $page, 'tags.php');
?>
<!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=gb2312" />
<title>标签管理</title>
<style type="text/css">
<!--
body,td {font-family: Geneva, Arial, Helvetica, sans-serif, Tahoma;font-size: 12px;color:#1876b7;}
.login {font-family: Geneva, Arial, Helvetica, sans-serif, Tahoma;font-size: 12px;height: 16px;border-top-width: 1px;border-right-width: 1px;border-bottom-width: 1px;border-left-width: 1px;border-top-color: #FFFFFF;border-right-color: #EEEEEE;border-bottom-color: #EEEEEE;border-left-color: #FFFFFF;background-color: #f2f2f2;}
input,textarea {font-family: Geneva, Arial, Helvetica, sans-serif, Tahoma;font-size: 12px;border-top-width: 1px;border-right-width: 1px;border-bottom-width: 1px;border-left-width: 1px;border-top-color: #FFFFFF;border-right-color: #EEEEEE;border-bottom-color: #EEEEEE;border-left-color: #FFFFFF;background-color: #f2f2f2;}
a {color: #1876b7;text-decoration: none;}
a:hover {color: #000000;text-decoration: underline;}
.smalltxt{ font: 11px Arial, Tahoma; }
Input,select,textarea{ font: 11px Tahoma, Verdana; color: #000000; font-weight: normal; background-color: #F8F8F8; }
form{ margin: 0; padding: 0;}
select{ font: 11px Arial, Tahoma; color: #000000; font-weight: normal; background-color: #F8F8F8; }
.nav{ font: 12px Tahoma, Verdana; color: #000000; font-weight: bold; }
.nav a{ color: #000000;}
.header{ font: 12px Tahoma, Verdana; color: #1876B7; font-weight: bold;background-color: #DAEEFA;background-image:url(images/header.gif);}
.header a{ color: #1876b7; }
.category{ font: 11px Arial, Tahoma; color: #000000; background-color: #EEF6F9; }
.tableborder{ background: #DCEEF6; border: 1px solid #98D5EC }
 .smalltxt{ font: 11px Arial, Tahoma; }
.bold{ font-weight: bold; }
.altbg1{ background: #F8F8F8; }
.altbg2{ background: #FFFFFF; }
.maintable{ width: 98%; background-color: #FFFFFF; }
.menu {color:#FFFFFF;}
.menu a{color:#FFFFFF;font-weight:bold;}
.menu a:hover{color:#CCFFFF;}
-->
</style>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table cellspacing="0" cellpadding="3" border="0" width="100%" align="center" style="table-layout: fixed"> 
<tr class="header" ><td width="90%" align="left" nowrap>
&nbsp;<a href=index.php>首页</a> &raquo; <a href=#><samp>标签管理</samp></a></td>    
</tr></table>
<table border="0" width="100%" cellspacing="1" cellpadding="3">
<tr>
<td class="altbg1"><?php
	$query = $db -> query("SELECT * FROM {$tablepre}tags $sql  ORDER BY count DESC LIMIT $start_limit, $pagenum");
	while($tags = $db -> fetch_array($query)){
  $tags['tags'] = $tags['tags'];
$tagss[$tags['id']] = $tags;
?>
 <a href="/search/?q=<?php echo urlencode($tags['tags']);?>" target="_blank"><?php echo $tags['tags'];?></a> <a href="?id=<?php echo $tags['id'];?>">(X)</a>  
<?php 
}
?></td></tr>
 </table>








