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

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

	check_authority();

	if ($mode == "edit") {

		if (!$num) {
			$newsortno = get_maxval("t3_".$dbid."_rss_group", "sortno", "") + 1;
			put_query ("insert into t3_".$dbid."_rss_group (sortno, title, regdate) values ($newsortno, '$title', '".time()."')");
			$num = get_maxval("t3_".$dbid."_rss_group", "no", "");
		} else {
			put_query ("update t3_".$dbid."_rss_group set title = '$title' where no = $num");
		}

		$row = split("\^", $editnum);
		array_pop($row);

		put_query ("update t3_".$dbid."_rss set pno = '0' where pno = '$num'");

		while (count($row)) {
			$rno = array_pop($row);
			put_query ("update t3_".$dbid."_rss set pno = '$num' where no = '$rno'");
		}
		check_query();

		header("Location: reader_address.php");
		exit;
	}

	if ($num) {
		$sql = "select title from t3_".$dbid."_rss_group where no = $num";
		list ($title) = @mysql_fetch_array(@mysql_query($sql));
	}

	admin_header("");
?>

	<script type="text/javascript" language="JavaScript">

		function addgroup(form, list1, list2) {
			if (list1.selectedIndex == -1) return false;
			var mtext = list1.options[list1.selectedIndex].text;
			var mvalue = list1.options[list1.selectedIndex].value;
			list1.options[list1.selectedIndex] = null;
			loc = list2.length;
			list2.options[loc] =  new Option(mtext,mvalue);
		}

		function onclick_reader_group_edit(form) {
			trim_all(form);
			if (isNull(form.title, '请输入书签分类名称')) return false;
			var temp = '';
			for(var i=0; i < form.glist.length; i++) {
				temp += form.glist[i].value + '^';
			}
			form.editnum.value = temp;
			form.mode.value = 'edit';
			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>

	<table cellpadding=0 cellspacing=0 border=0>
	<form method=post name=reader_group_edit action="<?=$PHP_SELF?>">
	<input type=hidden name=mode>
	<input type=hidden name=num value="<?=$num?>">
	<input type=hidden name=editnum>
	<tr>
	<td width=740 valign=top style=padding:5;padding-top:10>

	<table width=100% style=margin-bottom:3><tr>
	<td width=24 align=right><img src=../images/num_28.gif height=17></td>
	<td width=9><img src=../images/ver_01.gif width=9 height=17></td>
	<td><img src=../images/cap_28.gif height=17></td>
	</tr></table>

	<? print_content_line(); ?>


	<table class=content_back1 cellpadding=0 cellspacing=0 width=100%><tr>
	<td style=padding-top:10>

		<table style=margin-top:5;margin-bottom:10><tr>
		<td align=right width=100>收藏分类名称 :: </td>
		<td><input type=text class=text name=title value="<?=$title?>" style=width:488></td>
		</tr></table>

		<? input_block() ?>

		<table style=margin:10;margin-left:105><tr>
		<td style=font-size:10pt;font-weight:bold>
		未分类的订阅网站<br>
		<select name=tlist style=width:210 size=18 ondblclick="addgroup(document.reader_group_edit, document.reader_group_edit.tlist, document.reader_group_edit.glist);">
		<?

			$sql = "
				select
					no, xml_url, title, link, description, regdate
				from
					t3_".$dbid."_rss
				where
					pno = '0'
				order by
					title asc
			";
 			$result = @mysql_query($sql);
			while(list(
				$no, $xml_url, $title, $link, $description, $regdate
			) = @mysql_fetch_array($result)) {
				?><option value="<?=$no?>"><?=$title?></option><?
			}
		?>
		</select>
		</td>
		<td>
			<table><tr>
			<td><img class=ib src=../images/b_add.gif width=53 height=17 onclick="addgroup(reader_group_edit, document.reader_group_edit.tlist, document.reader_group_edit.glist);"></td>
			</tr><tr></tr><tr>
			<td><img class=ib src=../images/b_back_m.gif width=53 height=17 onclick="addgroup(reader_group_edit, document.reader_group_edit.glist, document.reader_group_edit.tlist);"></td>
			</tr></table>
		</td>
		<td style=font-size:10pt;font-weight:bold>
		此分类所属网站<br>
		<select name=glist style=width:210 size=18 ondblclick="addgroup(document.reader_group_edit, document.reader_group_edit.glist, document.reader_group_edit.tlist);">
		<?
			if ($num) {
				$sql = "
					select
						no, xml_url, title, link, description, regdate
					from
						t3_".$dbid."_rss
					where
						pno = '$num'
					order by
						title asc
				";
 				$result = @mysql_query($sql);
				while(list(
					$no, $xml_url, $title, $link, $description
					, $regdate
				) = @mysql_fetch_array($result)) {
					?>
					<option value="<?=$no?>"><?=$title?></option>
					<?
				}
			}
		?>
		</select>
		</td>
		</tr></table>

		<div style=padding:0;padding-left:108;color:#000030>
		在网站名称上双击可作左右移动.<br>
		网站分为此类后,以后将会列在此分类表内.
		</div>

		<center>
		<table cellpadding=0 cellspacing=0 style=margin:10><tr>
		<td><img class=ib src=../images/b_save.gif width=53 height=17 onclick="onclick_reader_group_edit(reader_group_edit);"></td>
		<td style=padding-left:5><img class=ib src=../images/b_cancel.gif width=53 height=17 onclick="window.location.href='reader_address.php'"></td>
		</tr></table>
		</center>

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

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

<? admin_footer(1); ?>