<div id="maincontent">
<div id="content">

<div id="contentright">

<div class="sidebox">
<div class="sideboxInner" >
	<h1>文字友情链接</h1>

		<div class="cover" >
		
			<ul class="links">
		<{section name=arrList  loop=$Links}>
			<li >
			<a href="<{$Links[arrList].url}>" title="<{$Links[arrList].title}>"><{$Links[arrList].title}></a>
			</li>
	  	<{sectionelse}>
		  对不起.暂时没有友情链接!
		<{/section}>
		</ul>
		<div class="clear"></div>
	  
		</div>
		<div class="postmetadata">
			<div id="pages"><{$pageInfo}></div></div>
		<div class="clear"></div>
		</div>
		
</div>
<div class="sidebox">
<div class="sideboxInner">
	<h2>友情链接申请区</h2>
<script type="text/javascript" language="Javascript" >
	function	ChangImg()
	{	
		var checkcode = $("#imgcode").get(0);
		var dt = new Date();
		checkcode.src = "<{$baseUrl}>/admin/auth/imgcode/t=" + dt;	
	}
	function ChangePhoto()
	{
		var headimg=$("#headimg").val();
		//alert(headimg);
		var checkcode = $("#headimgs").get(0);
		
		checkcode.src = "<{$baseUrl}>/public/images/headimg/"+headimg+".png";
	}
	function	submitlink()
	{	
		var title=$("#title").val();
		var	email=$("#email").val();
		var	content=$("#comcontent").val();
		var	imgcode=$("#code").val();
		var	url=$("#url").val();
		if(title==''){
			alert("网站或博客名不能为空!");
		}else if(url==''){
			alert("网站或博客链接地址不能为空!");
		}else if(email==''){
			alert("您的电子邮箱不能为空!");
		}else if(imgcode==''){
			alert("验证码不能为空!");
		}else{
		$.post("<{$baseUrl}>/link/add/",{title:title,url:url,content:content,imgcode:imgcode,email:email},
				function(data){
					//alert(data);
					var   strArray=new   Array();   
					strArray=data.split("||||");
					if(strArray[0]==0){
						$("#email").val('');
						$("#comcontent").val('');
						$("#code").val('');
						$("#title").val('');
						$("#titleflag").empty();
						$("#successflag").empty();
						$("#contentflag").empty();
						$("#codeflag").empty();
						$("#emailflag").empty();
						var checkcode = $("#imgcode").get(0);
						var dt = new Date();
						checkcode.src = "<{$baseUrl}>/admin/auth/imgcode/t=" + dt;
						$("#successflag").html(strArray[1]); 
					}else if(strArray[0]==1){
						$("#titleflag").empty();
						$("#successflag").empty();
						$("#contentflag").empty();
						$("#codeflag").empty();
						$("#emailflag").empty();
						$("#emailflag").html(strArray[1]); 
					}else if(strArray[0]==2){
						$("#titleflag").empty();
						$("#successflag").empty();
						$("#contentflag").empty();
						$("#codeflag").empty();
						$("#emailflag").empty();
						$("#titleflag").html(strArray[1]); 
					}else if(strArray[0]==3){
						$("#titleflag").empty();
						$("#successflag").empty();
						$("#contentflag").empty();
						$("#codeflag").empty();
						$("#emailflag").empty();
						$("#urlflag").html(strArray[1]); 
					}else if(strArray[0]==4){
						$("#titleflag").empty();
						$("#successflag").empty();
						$("#contentflag").empty();
						$("#codeflag").empty();
						$("#emailflag").empty();
						$("#codeflag").html(strArray[1]); 
					}
					
				});
		}
	}
</script>
		<div class="cover">
			<div class="entry">
	<form id="frmSumbit"  method="post" action="#" >

	<input type="hidden" name="articleId" id="articleId" value="<{$id}>" />
	<p><label for="title">网站或博客名称</label>&nbsp;&nbsp;&nbsp;<input type="text" name="title" id="title" class="text"  size="40" tabindex="1" /><span id="titleflag" style="color:red;"></span></p>
	<p><label for="url">网站或博客网址</label>&nbsp;&nbsp;&nbsp;<input type="text" name="url" id="url" class="text" value="http://" size="40" tabindex="7" /><span id="urlflag" style="color:red;">网址必须有http://</span></p>
	<p><label for="email">您的电子邮件</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="email" id="email" class="text"  size="40" tabindex="2" /><span id="emailflag" style="color:red;"></span></p>
	<p><label for="code">验&nbsp;&nbsp;&nbsp;证&nbsp;&nbsp;&nbsp;码&nbsp;&nbsp;&nbsp;&nbsp;</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="imgcode" id="code" class="text"  size="10" tabindex="3"   />&nbsp;&nbsp;<img id="imgcode" style="margin-bottom:-5px;cursor:pointer;" onclick="javascript:ChangImg()"   src="<{$baseUrl}>/admin/auth/imgcode/">&nbsp;点击图,换图片&nbsp;&nbsp;<span id="codeflag" style="color:red;"></span></p>
	<p><label for="content">网站描述(描述的最长字数:<font color="red">100</font>字)</label><span id="successflag" style="color:red;"></span></p>
	<p><textarea name="comcontent" id="comcontent"  class="text" cols="50" style="width:400px;" rows="4" tabindex="5" ></textarea><span id="contentflag"></span></p>
	<p><input name="butSumbit" type="button" tabindex="6" value="申请链接" onclick="javascript:submitlink()" class="button" /></p>
	</form>
	<p class="postbottom">◎欢迎您与本博客链接，希望我们可以成为朋友.谢谢!。</p>

			</div>
			
		</div>
		
		</div>
		
</div>






</div>

<div id="contentleft">

<{include file="../views/left.phtml" title="left"}>

</div>
		