<!--#include file="Admin.asp" -->
<!--#include file="cf.asp" -->
<!--#include file="adminconn.asp" -->
<!--#include file="../include/safe.asp"-->
<%

function htmls(shtml)
	dim objregexp, shtmls
	set objregexp = new regexp
	objregexp.ignorecase = true
	objregexp.global = true
	objregexp.pattern = "<.+?>"
	shtmls = objregexp.replace(shtml, "")
	htmls = shtmls
	set objregexp = nothing
end function

function encodestr(str)
	dim i
	str=trim(str)
	str=replace(str,"<","&lt;")
	str=replace(str,">","&gt;")
	str=replace(str,"'","""")
	str=replace(str,vbcrlf&vbcrlf,"</p><p>")
	str=replace(str,vbcrlf,"<br>")
	htmlencode = str
	encodestr=replace(str," ","")
	encodestr=replace(str,"&nbsp;","")
	if isnumeric(encodestr) then
        str=encodestr
    else
        str=0
    end if
end function %>
<html>
<head>
<title>友情链接</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../include/css.css" type="text/css">
</head>

<body>

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
          <td bgcolor="#ffffff"><table width=86% align=center border=0 cellpadding=0 cellspacing=1 bgcolor=#ff9900><tr><td bgcolor=#ffffff> 
            <table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#f3f3f3">
                    <form name="addlink" action="?action=add&id=<%=id%>" method="post">

                      <tr bgcolor="#ff9900"> 
                        <td height="30" colspan="2"><font color="#ffffff"><font color="#ffffff">　　&raquo;   
                          <b>添加友情链接</b></td>
                </tr>
                <tr> 
                  <td width="209" align="right">　
                    　网站名称： </td>
                  <td width="605"><input name="t1" type="text" id="t13"></td>
                </tr>
				 <tr> 
                  <td width="209" align="right">　
                    　显示排序： </td>
                  <td width="605"><input name="t0" type="text" id="t13"> 
                  数字越小越靠前</td>
                </tr>
                <tr> 
                  <td align="right">链接类型： </td>
                  <td width="605"><label> 
<input name="logoortxt" type="radio" value="0" checked>                    
图片链接</label> 
                  <label> 
                    <input type="radio" name="logoortxt" value="1">
                  文字链接</label> </td>
                </tr>
                <tr> 
                  <td align="right">　　连接地址： </td>
                  <td><input name="t2" type="text" id="t23" size="60"></td>
                </tr>
                <tr> 
                  <td align="right">　　logo图标： </td>
                  <td align="left"><table width="100%"><tr><td width="50%" align="left"><input name="pic_url" type="text" id="pic_url" size="30" maxlength="255"></td><td width="30%" align="left"><iframe border=0 frameborder=0 framespacing=0 height=22  marginheight=0 marginwidth=0 name=new_date noresize scrolling=no  src="upload3.asp" vspale="0"></iframe></td></tr></table></td>
                </tr>
                <tr> 
                  <td align="right" valign="top">站点说明：</td>
                  <td><textarea name="t4" cols="60" rows="5" id="t4"></textarea></td>
                </tr>
                <tr> 
                  <td colspan="2"> <div align="right">
                            <input type="submit" name="submit" value=" 添加 ">   
                    </div></td>
                </tr>
              </form>
            </table>
        </td>
    </tr>
</table>
        </td>
    </tr>
</table>
<%
if request("action")="add" then  
strsql = "select * from sogo_link"
set rs = server.createobject("adodb.recordset")
rs.open strsql,conn,1,2
rs.addnew
rs("sogo_link_font")=htmls(encodestr(request("t1")))
rs("sogo_link_url")=htmls(encodestr(request("t2")))
rs("sogo_link_login")=htmls(encodestr(request("pic_url")))
rs("sogo_link_alt")=htmls(encodestr(request("t4")))
rs("link_paixu")=htmls(encodestr(request("t0")))
rs("sogo_link_logo_or_txt")=htmls(encodestr(request("logoortxt")))
if session("aleave")="check" and session("userkey")<10 then
rs("sogo_link_yes_no")=0
else
rs("sogo_link_yes_no")=1
end if
rs.update
rs.close
response.redirect("admin_links.asp")
end if
%></td>
  </tr>
  <tr> 
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>

                                                              
                                                              
                                                              