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

if action="add" then
call web_head(0,0,0,0,0)
else
call web_head(0,0,0,0,0)
end if
%>

<%
response.write vbcrlf&"<table cellspacing=1 cellpadding=4 class=table>"

select case action
case "add"
  call links_add()
case else
  call links_view()
end select

response.write vbcrlf&"</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)
            call joekoe_cms.exec("insert into user_mail(accept_u,send_u,topic,word,tim,types,isread) values('"&web_dim(3)&"','"&login_username&"','有新的友情链接啦！','友情链接中有新的网站链接啦啦,请管理员查阅！','"&joekoe_cms.now_time&"',1,0)",0) 
    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=td0 colspan=2>&nbsp;用户自助添加链接</td></tr>
<tr class=bg_td height=0><td width='20%'></td><td width='80%'></td></tr>
<tr class=bg_td>
<td>自助连接类型：</td><td>
<input type=radio name=sort value='txt' checked>文字连接
<input type=radio name=sort value='fir'>首页链接
<input type=radio name=sort value='sec'>内页连接
<input type=radio name=sort value='forum'>论坛连接
</td></tr>
<tr class=bg_td>
<td>网站名称：</td>
<td><input type=text name=nname size=50 maxlength=20></td>
</tr>
<tr class=bg_td>
<td>链接地址：</td>
<td><input type=text name=url value='http://' size=50 maxlength=100></td>
</tr>
<tr class=bg_td>
<td>图片LOGO：</td>
<td><input type=text name=pic value='' size=60 maxlength=100></td>
</tr>
<tr class=bg_td>
<td>确定后提交！</td>



<td height=30><input type=submit value='提交添加'>　　<input type=reset value='重新填写'></td>

</tr>
</form>
<tr><td></td><td><font class=blue>********************************************</font></td>
</tr>
<tr class=bg_td>
<td><font class=red>注意事项：</font></td><td><font class=blue>请先做好与本站的连接，才有可能通过！相关地址图片如下</font></td>
</tr>

<%
end sub

sub links_view()
%>

<table width="777"><tr><td>
<table cellspacing=1 cellpadding=4 class=table>
  <tr class=bg_td>
    <td align=center height=20><a href='?action=add'><b><font class=blue>自助添加友情链接</font></b></a></td>
  </tr>
</table>
    <table align="center" cellpadding=0 cellspacing=0 class=table>
      <tr><td class=td0>&nbsp;首页链接</td></tr>
<tr><td align=center>
  <table border=0 width='777' cellspacing=0 cellpadding=0>
  <tr><td align=center><script language=javascript src='style/data_link.js'></script></td></tr>
  </table>
</td></tr>
<tr><td class=td0>&nbsp;内页链接</td></tr>
<tr class=bg_td><td align=center>
  <table border=0 width='100%' cellspacing=0 cellpadding=0>
  <tr><td align=center><script language=javascript src='style/data_link_sec.js'></script></td></tr>
  </table>
</td></tr>
<tr><td class=td0>&nbsp;论坛链接</td></tr>
<tr class=bg_td><td align=center>
  <table border=0 width='100%' cellspacing=0 cellpadding=0>
  <tr><td align=center><script language=javascript src='style/data_link_forum.js'></script></td></tr>
  </table>
</td></tr>
<tr><td class=td0>&nbsp;文字链接</td></tr>
<tr class=bg_td><td align=center>
  <table border=0 width='100%' cellspacing=0 cellpadding=0>
  <tr><td align=center><script language=javascript src='style/data_link_txt.js'></script></td></tr>
  </table>
</td></tr>

<tr class=bg_td>
  <td align=center><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>　</td>
      </tr>
    </table> 
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
        <td valign="top"><table cellspacing=0 cellpadding=0 class=table width="350">
            <tr> 
              <td class=td0>&nbsp; 本站链接代码</td>
            </tr>
            <tr class=bg_td> 
              <td align=center height=50><a href='<%response.write joekoe_cms.web_url%>' target=_blank><img border=0 src='image/logo.gif' width=88 heigh=31 alt='<%response.write joekoe_cms.web_name%>'></a></td>
            </tr>
            <tr class=bg_td> 
              <td align=center height=100>
				<textarea name=textarea rows=9 cols=30 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%>image/logo.gif' width=88 heigh=31 alt='<%response.write joekoe_cms.web_name%>'></a></textarea></td>
            </tr>
          </table></td>
        <td valign="top">
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr><td class=td0>&nbsp;链接说明</td></tr>
</table>
<table border=0 width=400>
            <tr>
              <td>1、站点必须内容详实，制作马虎或名不副实者恕不链接。</td>
            </tr>
            <tr>
              <td>2、含有修改浏览者默认页或注册表的网页不予链接。</td>
            </tr>
            <tr>
              <td>3、含有任何反动内容或色情内容的不予链接。</td>
            </tr>
          </table>
<table cellspacing=1 cellpadding=4 class=table id="table1" width="396">
  <tr>
    <td class=td0><a href='?action=add'><b><font class=blue>
	自助添加友情链接</font></b></a>
    </td>
  </tr>
  <tr class=bg_td>
    <td align=center height=20>
	<table class="table" cellSpacing="1" cellPadding="4" id="table4" width="387">
		<tr class="bg_td">
			<td><b><font class="red" color="#FF0000">注意事项：</font></b><font class="blue">请先做好与本站的连接，才有可能通过！</font></td>
		</tr>
	</table>
	</td>
  </tr>
</table>

<table cellspacing=1 cellpadding=4 class=table id="table2" width="394">
<tr><td class=td0>&nbsp;<img border=0 src='skin/skin_1/small/m_help.gif' align=absmiddle>&nbsp;帮助中心</td></tr>
<tr class=bg_td><td align=center>
  <table border=0 id="table3" width="289">
  <tr>
  <td width="98">
	<img border=0 src='skin/skin_1/small/m_help2.gif' align=absmiddle>&nbsp;<a href='help.asp'>网站介绍</a></td>
  <td width=90>
	<img border=0 src='skin/skin_1/small/m_help2.gif' align=absmiddle>&nbsp;<a href='help.asp?action=mail'>站内短信</a></td>
  <td width="84">
	<img border=0 src='skin/skin_1/small/m_help2.gif' align=absmiddle>&nbsp;<a href='help.asp?action=register'>注册说明</a></td>
  </tr>
  <tr>
  <td width="98">
	<img border=0 src='skin/skin_1/small/m_help2.gif' align=absmiddle>&nbsp;<a href='help.asp?action=put'>发布信息</a></td>
  <td width=90>
	<img border=0 src='skin/skin_1/small/m_help2.gif' align=absmiddle>&nbsp;<a href='help.asp?action=ubb'>UBB语法</a></td>
  <td width="84">
	<img border=0 src='skin/skin_1/small/m_help2.gif' align=absmiddle>&nbsp;<a href='help.asp?action=forum'>论坛帮助</a></td>
  </tr>
  </table>
</td></tr>
</table>

		</td>
      </tr>
    </table>
        </td>
      </tr></table>
<%
end sub
%>