<!--{template 'default/head'}-->
<style type="text/css">
.table-link{border-spacing:1px;border-collapse:separate;border:1px solid #ddd}
.table-link td{padding:2px 5px;background:#F1F3F5;height:32px;line-height:32px;}
.table-link th{text-align:center;background:#E4EDF9;padding:5px 0}
</style>
<div class="main cbody margintop">
	<div class="thisplace">
		<div class="placenav">
			<span>当前位置 :</span><a href="{W_P}">网站首页</a> &gt; <a href="index.php?ac=friend_link">友情链接</a>
		</div>
	</div>
	<!--{if $op == 'view'}-->
	<table border="0" cellspacing="1" cellpadding="1" width="100%" class="table-link">
		<tr>
			<th width="160">网站名称</th>
			<th width="100" align="center">网站LOGO</th>
			<th>网站简介</th>
			<th width="100">点击数</th>
			<th width="100">操作选项</th>
		</tr>
		<!--{loop $data $val}-->
		<tr>
			<td><a href="{W_P}index.php?ac=friend_link&op=url&id={$val['id']}" target="_blank">{$val['name']}</a></td>
			<td align="center">
				<!--{if $val['logo']}-->
					<a href="{W_P}index.php?ac=friend_link&op=url&id={$val['id']}" target="_blank"><img src="{$val['logo']}" width="83" height="31" /></a>
				<!--{/if}-->
			</td>
			<td style="padding-left:15px;">{$val['description']}</td>
			<td align="center">{$val['views']}</td>
			<td align="center"><a href="index.php?ac=friend_link&op=modify&id={$val['id']}">修改</a></td>
		</tr>
		<!--{/loop}-->
	</table>
	<!--{elseif $op == 'add' || $op == 'modify'}-->
	<script type="text/javascript">
	function checkSite(){
		var siteLogo = parseInt('{$_SET['plugin_site_logo']}');
		siteLogo = isNaN(siteLogo) ? 0 : 1;
		if(!$('site_name').value.trim()){
			$('site_name').focus();
			return false;
		}
		var url = $('site_url').value.trim();
		if(!url || url.indexOf('http') != 0){
			$('site_url').focus();
			return false;
		}
		if(siteLogo > 0 && $('site_logo').value.trim().substr(0, 7) != 'http://'){
			$('site_logo').focus();
			return false;
		}
		if(!$('site_pwd').value.trim()){
			$('site_pwd').focus();
			return false;
		}
		if(!$('verify_code').trim()){
			alert("需要输入验证码");
			$('verify_code').focus();
			return false;
		}
		$('submit-act').disabled = true;
		return true;
	}
	</script>
	<form action="index.php?ac=friend_link&op={$op}&id={$id}" method="post" onsubmit="return checkSite()">
		<table cellpadding="2" cellspacing="1" class="table-link" width="100%">
			<tr>
				<td width="25%" style="text-align:right;padding-right:15px">网站名称</td>
				<td>
					<p style="padding:2px">
						<input type="text" class="f-text" size="30" style="width:150px"  name="param[name]" id="site_name" value="{$data['name']}" /> <span style="color:green;margin:0 5px">必填项</span>
					</p>
				</td>
			</tr>
			<tr>
				<td style="text-align:right;padding-right:15px">网站地址</td>
				<td>
					<p style="padding:2px">
						<input type="text" class="f-text" style="width:350px" name="param[url]" id="site_url" value="{$data['url']}"/><span style="color:green;margin:0 5px">必填项</span>
					</p>
				</td>
			</tr>
			<tr>
				<td style="text-align:right;padding-right:15px">网站logo</td>
				<td>
					<p style="padding:2px">
						<input type="text" class="f-text" style="width:350px" name="param[logo]" id="site_logo" value="{$data['logo']}" />
						<!--{if $_SET['plugin_site_logo']}--><span style="color:green;margin:0 5px">必填项</span><!--{/if}-->
					</p>
				</td>
			</tr>
			<tr>
				<td style="text-align:right;padding-right:15px">操作密码</td>
				<td>
					<p style="padding:2px">
						<input type="text" class="f-text" style="width:150px" name="param[pwd]" id="site_pwd" value="" />
						<span style="color:green;margin:0 5px">必填项，<!--{if $op == 'add'}-->此密码用以日后修改之用<!--{else}-->请输入密码以确认身份<!--{/if}--></span>
					</p>
				</td>
			</tr>
			<tr>
				<td style="text-align:right;padding-right:15px">介绍</td>
				<td><textarea  class="f-text" style="width:350px;height:60px;font-size:12px;"  name="param[description]">{$data['description']}</textarea></td>
			</tr>
			<tr>
				<td style="text-align:right;padding-right:15px">验证码</td>
				<td>
					<input type="text" name="verify_code" id="verify_code" autocomplete="off" class="f-text" type="text" maxlength="4" size="12" style="width:60px" /> 
					<img title="点击更换图片" src="code.php?height=24&bgcolor=ffffff" onclick="return changeVerifyImage(24)" id="verify_code_img" />
					<font color="#999">把图片上的数字输入一遍，</font><a href="###" onclick="return changeVerifyImage(24)">看不清楚？换一张</a>				
				</td>
			</tr>
			<!--{if $op == 'modify'}-->
			<tr>
				<td style="text-align:right;padding-right:15px">删除</td>
				<td><input type="checkbox" value="1" name="delete" /></td>
			</tr>
			<tr>
				<td style="text-align:right;padding-right:15px">说明</td>
				<td><span style="color:green;margin:0 5px">您的任何修改都需经过管理员的审核后才能生效</span></td>
			</tr>
			<!--{/if}-->
			<tr>
				<td></td>
				<td>
					<input type="hidden" name="myFormAc"  value="update" />
					<input type="submit" id="submit-act" class="f-button" value=" 提交 " />
				</td>
			</tr>
		</table>
	</form>
	<!--{/if}-->
</div>
<!--{template 'default/foot'}-->