www.gusucode.com > Tatter Tools 0.961 SE GB2312 简体中文版 > upload/admin/keyword.php

    <?
	include("../inc_global.php");
	include("../inc_function.php");
	check_authority();

	if ($mode == "set_public") {
		list($num, $is_public, $is_sync) = split("_", $exenum);
		if ($is_public) $mode = 0; else $mode = 1;
		set_keyword_public($num, $mode, $is_sync);
		write_local_keyword_cache();
		header("Location: keyword.php?page=$page");
		exit;
	}

	if ($mode == "set_sync") {
		list($num, $is_sync, $is_public) = split("_", $exenum);
		if ($is_sync) $mode = 0; else $mode = 1;
		set_keyword_sync($num, $mode, $is_public);
		write_local_keyword_cache();
		header("Location: keyword.php?page=$page");
		exit;
	}

	if ($mode == "set_delete") {
		$sql = "select image_file_path1, image_file_path2 from t3_".$dbid."_keyword where no = $exenum";
		list ($image_file_path1, $image_file_path2) = mysql_fetch_array(mysql_query($sql));
		force_rmdirs($r_attach_path.$image_file_path1.$image_file_path2);
		if (is_empty_dir($r_attach_path.$image_file_path1)) force_rmdirs($r_attach_path.$image_file_path1);
		put_query ("delete from t3_".$dbid."_keyword where no = $exenum");
		put_query ("delete from t3_".$dbid."_keyword_files where pno = $exenum");
		write_local_keyword_cache();
		set_keyword_sync($exenum, 0, 1);
		header("Location: keyword.php?page=$page");
		exit;
	}

	if (!$page) $page=1;

	admin_header("");
?>

<script type="text/javascript">

	function move(page_num) {
		keyword.page.value = page_num;
		keyword.submit();
	}

	function set_public(form, num, is_public, is_sync) {
		form.mode.value = 'set_public';
		form.exenum.value = num + '_' + is_public + '_' + is_sync;
		form.submit();
	}

	function set_sync(form, num, is_sync, is_public) {
		form.mode.value = 'set_sync';
		form.exenum.value = num + '_' + is_sync + '_' + is_public;
		form.submit();
	}


	function set_delete(form, num) {
		if (!confirm('将删除此关键词解释所有的内容及附件.确定要继续吗?\t')) return false;
		form.mode.value = 'set_delete';
		form.exenum.value = num;
		form.submit();
	}

</script>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=GB2312">
<meta name="keywords" content="TT,TatterTools,Skin,php">
<meta name="description" content="Meyu,梦游,华人中文网">
<meta name="generator" content="TatterTools中文BLOG">
<meta name="MSSmartTagsPreventParsing" content="TRUE">
<meta http-equiv="MSThemeCompatible" content="Yes">
</head>
<form method="get" name="keyword" action="<?=$PHP_SELF?>">
<input type="hidden" name="mode">
<input type="hidden" name="exenum">
<input type="hidden" name="page" value="<?=$page?>">
<input type="hidden" name="idx" value="<?=$idx?>">

	<table cellpadding="0" cellspacing="0"><tr>
	<td width="740" valign="top" style="padding:10 5 5 5">

		<table width="100%" style="margin-bottom:3"><tr>
		<td width="24" align="right"><img src="../images/num_07.gif" height="17" alt=""></td>
		<td width="9"><img src="../images/ver_01.gif" width="9" height="17" alt=""></td>
		<td><img src="../images/cap_07.gif" width="92" height="17" alt=""></td>
		<td align="right"><img class="ib" src="../images/b_add.gif" width="53" height="17" onclick="if (confirm('将要新增关键词解释. 确定要继续吗?\t')) window.location.href='keyword_edit.php?mode=issue';" alt="点击新增关键词解释"></td>
		</tr></table>

	<? print_content_line(); ?>

		<table cellpadding="0" cellspacing="0" width="100%">
		<?
			unset($add_query);

			$sql = "select count(*) from t3_".$dbid."_keyword where 1 $add_query";
			list ($totalcount) = mysql_fetch_array(mysql_query($sql));

			$pagelog = $p_keyword_cnt;

			if ($idx) {
				$order = "order by keyword asc";
				$pagelog = 100000000;
			} else {
				$order = "order by no desc";
			}

			if ($page==1) $prev_page = 1; else $prev_page = $page - 1;
			if (!$pagelog) $pagelog = 1;
			$article_start = (($page-1)*$pagelog);
			$article_end = $page * $pagelog;

			if ($article_end >= $totalcount) $article_end = $totalcount;
			$final_page = intval(($totalcount+$pagelog-1) / $pagelog);
			if ($page>=$final_page) { $next_page = $final_page; } else { $next_page = $page+1; }
			if ($article_start==$article_end && $page > 1) { $page--; $article_start -= $pagelog; }
			if (!$final_page) $final_page = 1;

			$sql = "
				select
					no, sortno, keyword, body, image_file_path1, image_file_path2, regdate, is_public, is_sync
				from
					t3_".$dbid."_keyword
				where 1
					$add_query
				order by
					no desc
				limit $article_start,
			".intval($article_end-$article_start);
			// print $sql;
 			$result = @mysql_query($sql);
			$flag = false;

			while(list($no, $sortno, $keyword, $body, $image_file_path1, $image_file_path2, $regdate, $is_public, $is_sync) = @mysql_fetch_array($result)) {
				if ($flag) { ?><tr><td colspan="5" height="1" background="../images/dot_width2.gif"></tr><? }

				$flag = true;
				?>
				<tr>
				<td width="56" style="padding-left:5;"><img class="ib" src="../images/public<? if (!$is_public) { ?>_g<? } ?>.gif" width="51" height="14" onclick="set_public(keyword, '<?=$no?>', '<?=$is_public?>', '<?=$is_sync?>')" alt=""><br></td>
				<td width="51"><img class="ib" src="../images/sync<? if (!$is_sync) { ?>_g<? } ?>.gif" width="41" height="14" onclick="set_sync(keyword, '<?=$no?>', '<?=$is_sync?>', '<?=$is_public?>')" alt=""></td>
				<td width="65" class="h1" align="center"><?=get_timevalue0($regdate,1)?></td>
				<td width="*" style="padding:3 0 0 4"><a href="keyword_edit.php?num=<?=$no?>&page=<?=$page?>&idx=<?=$idx?>"><?=$keyword?></a></td>
				<td width="56"><img class="ib" src="../images/b_edit.gif" width="53" height="17" onclick="window.location.href='keyword_edit.php?num=<?=$no?>&page=<?=$page?>&idx=<?=$idx?>'" alt=""></td>
				<td width="56"><img class="ib" src="../images/b_delete.gif" width="53" height="17" onclick="set_delete(keyword, '<?=$no?>')" alt=""></td>
				</tr>
				<?
			}
		?>
		</table>

		<table cellpadding="0" cellspacing="0" width="100%" style="margin-top:2"><tr>
		<td class="h2" height="30" align="center" background="../images/list_bottom1.jpg" style="padding-top:20;">
		<a href="javascript:move('1')">[1]</a> .. |
		<a href="javascript:move('<?=$prev_page?>')">PREV</a> |
		<?
			for ($i=($page-5);$i<$page;$i++) if ($i>0) print "<a href=\"javascript:move('$i')\">[$i]</a> ";
			print " <font color=\"#E04040\">[".$page."]</font> ";
			for ($i=($page+1);$i<($page+5);$i++) if ($i <= $final_page) print " <a href=\"javascript:move('$i')\">[$i]</a>";
		?>
		| <a href="javascript:move('<?=$next_page?>')">NEXT</a>
		| .. <a href="javascript:move('<?=$final_page?>')">[<?=$final_page?>]</a>
		</td>
		</tr></table>

		<center>
		<table style="margin:20 0 0 0"><tr>
		<td><img src="../images/sc.gif" width="16" height="16" alt=""></td>
		<td style="padding:2 0 0 2"><a href="#" onclick="layer_toggle(document.getElementById('sc1')); return false;">本页快捷键列表</a></td>
		</tr></table>

					<div id="sc1" style="display:none;padding:10 5 5 15">
			<table><tr><td>
			<span class="sc" style="padding:1 4 2 4;">A</span> - 网志列表
			&nbsp; <span class="sc" style="padding:1 4 2 4;">S</span> - 下一页
			&nbsp; <span class="sc" style="padding:1 4 2 4;">Q</span> - 不退出返回首页
			<div style="margin:10 0 0 0"></div>
			<span class="sc" style="padding:1 4 2 5;">R</span> - 传送引用的第一页
			&nbsp; <span class="sc" style="padding:1 5 2 5;">T</span> - 收藏文章
			&nbsp; <span class="sc" style="padding:1 5 2 5;">F</span> - 未读的文章
			&nbsp; <span class="sc" style="padding:1 4 2 4;">G</span> - 脚本的文章
			</td></tr></table>
			</div>
		</center>

	</td>
	</tr></table>

</form>

<script type="text/javascript">

	function shortcut_onkeydown(evt) {
		evt = get_event(evt);
		if ((set_key = evt.keyCode) && chk_event_tag_name(evt) && !(evt.altKey || evt.ctrlKey)) {
			if (set_key == '83') move('<?=$next_page?>');
			else if (set_key == '65') move('<?=$prev_page?>');
			else if (set_key == '70') window.location.href='reader.php?nr=1';
			else if (set_key == '71') window.location.href='reader.php?sc=1';
			else if (set_key == '82') window.location.href='reader.php';
			else if (set_key == '84') window.location.href='reader.php?rc=1';
			else if (set_key == '81') window.location.href='../index.php';
		}
	}

	document.onkeydown = shortcut_onkeydown;

</script>

<? admin_footer("") ?>