<!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>友情链接 - powered by dedecms</title>
<link href="../templets/style/nspage.css" rel="stylesheet" type="text/css" />
</head>

<?php
	$titlelen = 50;
	$dsql = new DedeSql(false);
	$dsql->SetQuery("Select * from #@__flink where ischeck>0 order by sortrank asc");
	$dsql->Execute();
	$txtlink ="";
	$imglink ="";
	$linkdata = "";
	while($dbrow=$dsql->GetObject())
	{
		$wtitle = cn_substr($dbrow->webname,$titlelen);
		
		if($dbrow->logo==""){
			$txtlink .= "<a href='".$dbrow->url."' target='_blank'>$wtitle</a>\n\t\t\t\t\t";
		}else{
			$imglink .= "<a href='".$dbrow->url."' target='_blank'><img src='".$dbrow->logo."' width='88' height='31' border='0' alt='$wtitle'></a>\n\t\t\t\t\t";
		}
	}
	$dsql->Close();

	if($dopost=="save"){
	  ShowMsg("成功增加一个链接，但需要审核后才能显示!","",1);
	}
?>
<body>

<div class="main mceneter">
	<div class="toplogo">
		<div class="logo">
				<a href="/"><img src="../templets/images/toplogo.gif" /></a>		</div>
		<div class="title">
			友情链接
		</div>
	</div>
	<div class="cmain">
		<div class="ctitle">
			<h1>所有链接</h1>
			<span></span>
		</div>
		<div class="cbox mceneter">
			<div class="linklist">
				
				<div class="txtlink">
					<?php echo $txtlink; ?>
				
				</div>
				<div class="imglink">
					<?php echo $imglink; ?>
					
				</div>
			</div>
		</div>
		
		<div class="ctitle">
			<h1>申请加入</h1>
			<span></span>
		</div>
		<div class="cbox mceneter">
			<div class="linkadd">
			<form name="addlink" method="post" action="flink.php">
			<input type='hidden' name='dopost' value='save' />
				<dl>
					<dt>网站名:</dt>
					<dd><input name="webname" type="text" size="30" />
					</dd>
				</dl>
				<dl>
					<dt>网址:</dt>
					<dd><input name="url" type="text" size="30" />
					</dd>
				</dl>
				<dl>
					<dt>网站LOGO:</dt>
					<dd><input name="logo" type="text" size="30" />
					</dd>
				</dl>
				<dl>
					<dt>站长eMail:</dt>
					<dd><input name="email" type="text" size="30" />
					</dd>
				</dl>
				<dl>
					<dt>网站类型:</dt>
					<dd>
						<select name="typeid" id="typeid">
							<?php 
								$dsql = new DedeSql(false);
								$dsql->SetQuery("select * from #@__flinktype");
								$dsql->Execute();
								while($row=$dsql->GetObject())
								{
								echo "	<option value='".$row->ID."'>".$row->typename."</option>\r\n";
								}
								$dsql->Close();
							?>
						</select>
					</dd>
				</dl>
				<dl>
					<dt>网站概况:</dt>
					<dd><textarea name="msg" cols="30" rows="3"></textarea>
					</dd>
				</dl>
				<dl>
					<dt>验证码:</dt>
					<dd><input name="validate" type="text" size="4" /><img src="../include/vdimgck.php" width="50" height="20" />
					</dd>
				</dl>
				<div class="submit">
					<input name="提交" type="submit" id="提交" value="提交" class="button" />
				</div>
			</form>
			</div>
		</div>
	</div>
</div>
<div class="copyright mceneter">
Powered by <a href="http://www.dedecms.com" target="_blank">DedeCms <?php echo $cfg_version ?></a> &copy; 2004-2008  <a href="http://www.desdev.cn" target="_blank">DesDev</a> Inc.
</div>


</body>
</html>
