{template 'phpcms','header'}

<SCRIPT LANGUAGE="JavaScript">
<!--
function ajaxlink(id)
{
    var url =  "{$MOD[linkurl]}update_hits.php";
    var pars = "linkid="+id;
    var myAjax = new Ajax.Request(url, {method: 'get', parameters: pars});
	
}
function CheckReg()
{
	if(document.myform.typeid.value=='0'){
      alert('请选择分类！');
      document.myform.typeid.focus();
      return(false) ;
    }
    if(document.myform.name.value==''){
      alert('网站名不能为空！');
      document.myform.name.focus();
      return(false) ;
    }
  if(document.myform.name.value.length>30){
    alert('网站名太长了！');
    document.myform.name.focus();
    return(false);
  }

  if(document.myform.url.value=='' || document.myform.url.value=='http://'){
      alert('网站地址不能为空！');
      document.myform.url.focus();
      return(false) ;
    }

}
//-->
</script>

<table width="980" cellpadding="1" cellspacing="1">
<tr>
<td valign="top" width="230">
<table width="228" cellspacing="0" cellpadding="0">
  <tr>
    <td><a href="{$MOD['linkurl']}"><img src="{$skindir}/images/link.gif" alt="" width="228" height="27" border="0"/></a></td>
  </tr>
  <tr>
    <td style="border:1px solid #999999;border-top-width:0;">
<table width="100%" cellspacing="0" cellpadding="0" class="righttable">
<!--{loop $tname $i $v}-->
	<!--{if $i%2==0}-->
	<tr>
	<!--{/if}-->
    <td width="50%" height="24" align="center" style="border-right:1px solid #dcdcdc"><a href="{$v['type']}.{$PHPCMS['fileext']}" style="{$v['style']}">{$v['name']} </a>
	</td>
   <!--{if $i%2==1}-->
	  </tr>
   <!--{/if}-->
<!--{/loop}-->
</table>

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

<table width="100%" cellspacing="0" cellpadding="0" style="border:1px solid #999999;" class="mar_10">
    <tr>
		<td id='TabTitle0' onclick='ShowTabs(0)' style="cursor:hand;background:#F5F5F5;letter-spacing:1px;">　申请链接</td>
		<td id='TabTitle1' onclick='ShowTabs(1)' style="cursor:hand;background:#F5F5F5;letter-spacing:1px;">获取代码</td>
		<td id='TabTitle2' onclick='ShowTabs(2)' style="cursor:hand;background:#F5F5F5;letter-spacing:1px;">修改链接</td>
	</tr>
</table>

	<table width="100%" cellpadding="0" cellspacing="0" class="righttable" style="border:1px solid #999999;border-top-width:0;">
	<tbody id="Tabs0" style="display:">
	<form method="post" name="myform" action="{$MOD[linkurl]}register.php?action=reg" onsubmit="return CheckReg()">
	<tr>
	<td>　链接类型：
	  <input name="linktype"  type="radio" value="1" checked style="border:0" onclick="$('showTabs').style.display='block'">
	LOGO&nbsp;&nbsp;
	<input type="radio" name="linktype" value="0" style="border:0" onclick="$('showTabs').style.display='none'">
	文字</td>
	</tr>
	<tr>
	<td>　所属分类：　  <select name="typeid"> {$linktype_select} </select><font color="#FF0000"> *</font></td>
	</tr>
	<tr>
	<td>　网站名称：　 <input name="name" size="18"  maxlength="20"><font color="#FF0000"> *</font></td>
	</tr>
	<tr>
	<td>　网站地址：　 <input name="url" size="18"  maxlength="100" type="text"  value="http://">
	<font color="#FF0000">*</font></td>
	</tr>
	<tr id='showTabs'>
	<td>　网站标志：　
	  <input name="logo" size="18"  maxlength="100" type="text"  value="http://"></td>
	</tr>
	
	<tr>
	<td align="center"><textarea name="introduce" cols="30" rows="5" id="introduce">网站简介：</textarea></td>
	</tr>
	<!--{if $enablecheckcode}-->
	<tr>
	<td>　
	验证码：<input name="checkcodestr" type="text" size="6">
<img src="{PHPCMS_PATH}checkcode.php" id="checkcode" onclick="this.src='{PHPCMS_PATH}checkcode.php?id='+Math.random()*5;" style="cursor:pointer;" alt="验证码,看不清楚?请点击刷新验证码" align="absmiddle"/>
	</td>
	</tr>
	<!--{/if}-->
	<tr>
		<td align="center" height="30">
		<input name="submit" type="submit" value=" 提 交 " class="btn">&nbsp;&nbsp;
		<input name="reset" type="reset" value=" 重 填 " class="btn">		</td>
	  </tr>
	  </form>

	<tbody id='Tabs1' style='display:none'>
	<form method="post" name="link">
	<tr>
		<td>　本站LOGO链接代码　</td>
	</tr>
	<tr>
	  <td>　<textarea name="logo" cols="30" rows="5" id="logo" onfocus="document.link.elements['logo'].select();"><a href="{$PHP_SITEURL}" target="_blank"><img src="{$logo}" width="88" height="31" border="0"></a></textarea></td>
		</tr>
	<tr>
		<td>　本站文字链接代码　</td>
		</tr>
	<tr>
	  <td>　<textarea name="text" cols="30" rows="5" id="text" onfocus="document.link.elements['text'].select();"><a href="{$PHP_SITEURL}" target="_blank">{$sitename}</a></textarea></td>
		</tr>
        <tr><td height="10"></td></tr>
	</form>
	  </tbody>

	 <tbody id="Tabs2" style="display:none">
	  <form method="post" name="edit" action="{$MOD[linkurl]}register.php?action=edit">
		<tr>
		<td>　链接类型： 　<input name="linktype" type="radio" value="1" checked style="border:0" onclick="$('editshowTabs').style.display='block'">
		LOGO&nbsp;&nbsp;
		<input type="radio" name="linktype" value="0" style="border:0" onclick="$('editshowTabs').style.display='none'">
		文字</td>
		</tr>
	<tr>
	<td>　所属分类：　  <select name="typeid"> {$linktype_select} </select><font color="#FF0000"> *</font></td>
	</tr>
	<tr>
		<td>　网站名称： 　<input name="name" size="18"  maxlength="20"><font color="#FF0000"> *</font></td>
		</tr>
	<tr>
		<td>　网站地址： 　<input name="url" size="18"  maxlength="100" type="text"  value="http://">
		<font color="#FF0000">*</font></td>
		</tr>
	<tr id="editshowTabs">
		<td>　网站Logo：　<input name="logo" size="18"  maxlength="100" type="text"  value="http://"></td>
		</tr>
	<tr>
		<td><br /><textarea name="introduce" cols="30" rows="5" id="introduce">网站简介：</textarea></td>
		</tr>
		
	<tr>
		<td align="center" height="30">
		<input name='submit' type='submit' value=' 修 改 ' class="btn">&nbsp;&nbsp;
		<input name='reset' type='reset' value=' 重 填 ' class="btn">		</td>
	  </tr>
	  </form>
	  </tbody>
</table>
</td>
<td width="10"></td>
<td width="730" valign="top">

<div class="memberborder_1">
<div class="memberborder_2">
<h1> 当前位置：<a href="{$MOD['linkurl']}">链接首页</a> >> {$TYPE[$typeid]['name']}</h1>
<div class="righttable">
<!--标准logo链接-->
	 {$link_list(0,$typeid,1,20,9,1)}
<!--文字logo链接-->
	 {$link_list(0,$typeid,0,20,9,1)}
</div> 
</div></div>

</td>
</tr>
</table>
{template 'phpcms','footer'}