<!-- #include file="include/con_help.asp" -->
<!-- #include file="../include/jk_val_code.asp" -->
<%
index_url="links"
url_fir="links.asp"
select case action
case "add"
  tit_fir="友情链接"
  tit="自助交换链接"
  call web_head(2,0,0,0,0)
case else
  tit="友情链接"
  call web_head(0,0,0,0,0)
end select

'----------------------------左边 开始----------------------------
%>
<table cellspacing=1 cellpadding=4 class=table>
<tr><td class=td>&nbsp;<%response.write tit%></td></tr>
<tr class=tr><td align=center height=50><a href='<%response.write joekoe_cms.web_url%>' target=_blank><img border=0 src='../images/logo.gif' width=88 heigh=31 alt='<%response.write joekoe_cms.web_name%>'></a></td></tr>
<tr class=tr><td align=center height=100><textarea name=flink_main rows=5 cols=21 onfocus=this.select() onmouseover=this.focus()><a href='<%response.write joekoe_cms.web_url%>' target=_blank><img border=0 src='<%response.write joekoe_cms.web_url%>images/logo.gif' width=88 height=31 alt='<%response.write joekoe_cms.web_name%>'></a></textarea></td></tr>
<tr class=bg_tds><td align=center height=20><a href='?action=add'><b>自助添加友情链接</b></a></td></tr>
</table>
<%
response.write ukong
call left_help()
response.write ukong
'----------------------------左边 结束----------------------------
call web_center(0)
'----------------------------中间 开始----------------------------
response.write "<table cellspacing=1 cellpadding=4 class=table>"
if action="add" then
  call links_add()
else
  call links_view()
end if
response.write "</table>"
'----------------------------中间 结束----------------------------
call web_end(0,0)

sub links_add()
  dim nname,nurl,npic,orders,nsort,hidden,valcode,found_err,sort
  if joekoe_cms.chk() then
    nname=trim(request.form("nname"))
    nname=joekoe_cms.code_form(nname)
    nurl=trim(request.form("url"))
    nurl=joekoe_cms.code_form(nurl)
    npic=trim(request.form("pic"))
    npic=joekoe_cms.code_form(npic)
    sort=trim(request.form("sort"))
    sort=joekoe_cms.code_form(sort)
    valcode="jk"&trim(request.form("valcode"))

    found_err=""
    if nname="" then
      found_err=found_err & "+请输入您的 <font class=red>网站名称</font>（长度不能大于20）<br>"
    end if
    if nurl="" or lcase(nurl)="http://" or len(nurl)>100 then
      found_err=found_err & "+网站名称 不能为空！（长度不能大于100）<br>"
    end if
    if sort<>"txt" then 
    if npic="" or len(npic)>100 then
      found_err=found_err & "+图片地址 不能为空！（长度不能大于100）<br>"
    end if
    end if
    if val_chk(index_url)=false then
      found_err=found_err &"+您输入的 <font class=red>验 证 码</font> 为空或有错误，请勿非法提交！<br>"
    end if
    if found_err<>"" then
      response.write "<tr class=bg_td><td align=center height=300 colspan=3>"&found_error(found_err,260)&"</td></tr>"
      exit sub
    end if
    orders=1
    sql="select top 1 orders from links where sort='fir' order by orders desc"
    set rs=joekoe_cms.exec(sql,1)
    if not rs.eof then orders=int(rs("orders"))+1
    rs.close
    
    sql="select * from links"
    call joekoe_cms.exec("",-1)
    rs.open sql,conn,1,3
    rs.addnew
    rs("orders")=orders
    rs("sort")=code_admin("sort",1,100)
    rs("nname")=nname
    rs("url")=code_admin("url",1,100)
    rs("pic")=code_admin("pic",1,100)
    rs("hidden")=false
    rs.update
    rs.close
%>
<tr class=bg_td><td align=center height=300 colspan=3>
<font class=red>谢谢你与本站交换友情链接！请先做好本站链接，审核后即可开通！</font><br><br>
<a href='links.asp'>返回友情链接</a><br><br>
（系统将在 <font class=red><%response.write dim_num(21)%></font> 秒钟后自动返回）
<meta http-equiv='refresh' content='<%response.write dim_num(21)%>; url=links.asp'>
</td></tr>
<%
    call val_chk_end(index_url)
    exit sub
  end if
%>
<form name=linkfrom action='?action=add' method=post onsubmit="frm_submitonce(this);">
<input type=hidden name=chk value='yes'>
<%response.write val_code_num(index_url,1)%>
<tr><td class=td colspan=2>&nbsp;自助添加链接</td></tr>
<tr class=bg_td>
<td <%response.write dd1%> align=center>网站名称：</td>
<td <%response.write dd2%>><input type=text name=nname size=50 maxlength=20></td>
</tr>
<tr class=bg_td>
<td align=center>链接类型：</td><td>
<input type=radio name=sort value='fir' class=bg_td checked>首页链接
<input type=radio name=sort value='sec' class=bg_td>内页连接
<input type=radio name=sort value='forum' class=bg_td>论坛连接
<input type=radio name=sort value='txt' class=bg_td>文字连接
<input type=radio name=sort value='ftxt' class=bg_td>论坛文字连接
</td></tr>
<tr class=bg_td>
<td align=center>链接地址：</td>
<td><input type=text name=url value='http://' size=50 maxlength=100></td>
</tr>
<tr class=bg_td>
<td align=center>图片地址：</td>
<td><input type=text name=pic value='' size=60 maxlength=100></td>
</tr>
<tr class=bg_tds>
<td height=30 colspan=2 align=center><input type=submit class=btn value='提交添加'>　　<input type=reset class=btn value='重新填写'></td>
</tr></form>
<tr><td colspan=2 align=center class=tr></td></tr>

<tr><td class=td colspan=2>&nbsp;注意事项</td></tr>
<tr class=bg_td><td align=center><font class=red><b>特别注意：</b></font></td><td><b>请先做好与本站的连接，并遵守一下规则。才有可能通过审核！</b></td>
</tr>
<tr class=bg_td>
<td align=center></td>
<td>1、站点必须内容详实，制作马虎或名不副实者恕不链接。</td>
</tr>
<tr class=bg_td>
<td align=center></td>
<td>2、含有修改浏览者默认页或注册表的网页不予链接。</td>
</tr>
<tr class=bg_td>
<td align=center></td>
<td>3、含有任何反动内容或色情内容的不予链接。</td>
</tr>
<%
end sub

sub links_view()
%>

  <table cellspacing=1 cellpadding=4 class=tables>
  <tr><td class=td>&nbsp;首页链接</td></tr>
  <tr class=tr><td align=center><script language=javascript src='<%=joekoe_cms.web_path%>style/data_link_fir.js'></script></td></tr>
  </table>
<%=ukong%>
  <table cellspacing=1 cellpadding=4 class=tables>
  <tr><td class=td>&nbsp;内页链接</td></tr>
  <tr class=tr><td align=center><script language=javascript src='<%=joekoe_cms.web_path%>style/data_link_sec.js'></script></td></tr>
  </table>
<%=ukong%>
  <table cellspacing=1 cellpadding=4 class=tables>
  <tr><td class=td>&nbsp;论坛链接</td></tr>
  <tr class=tr><td align=center><script language=javascript src='<%=joekoe_cms.web_path%>style/data_link_forum.js'></script></td></tr>
  </table>
<%=ukong%>
  <table cellspacing=1 cellpadding=4 class=tables>
  <tr><td class=td>&nbsp;文字链接</td></tr>
  <tr class=tr><td align=center ><script language=javascript src='<%=joekoe_cms.web_path%>style/data_link_txt.js'></script></td></tr>
  </table>
<%=ukong%>
  <table cellspacing=1 cellpadding=4 class=tables>
  <tr><td class=td> 论坛文字链接</td></tr>
  <tr class=tr><td align=center ><script language=javascript src='<%=joekoe_cms.web_path%>style/data_link_ftxt.js'></script></td></tr>
  </table>
 <%=ukong%>
  <table cellspacing=1 cellpadding=4 class=tables>
  <tr><td class=td>链接说明</td></tr>
  <tr class=tr><td align=left>
  <table border=0 width=450>
  <tr><td>1、站点必须内容详实，制作马虎或名不副实者恕不链接。</td></tr>
  <tr><td>2、含有修改浏览者默认页或注册表的网页不予链接。</td></tr>
  <tr><td>3、含有任何反动内容或**内容的不予链接。</td></tr>
  </table>
  </td></tr>
  </table>
<%=ukong%> 
<%
end sub
%>