www.gusucode.com > cso中国seo优化html整站源码程序 > manage/info/i_links.asp
<!--#include file="../include/head.asp"--> <% flagstr = "i_links" call checkflag(flagstr) session("curpage") = "info/"&flagstr&".asp" main_title = "友情链接" %> <table cellspacing="1"> <thead><tr><th><%=main_title%>管理选项</th></tr></thead> <tbody><tr><td> <a class="add" href="?act=add">添加<%=main_title%></a> <a class="man" href="?act=man">管理<%=main_title%></a> </td></tr></tbody> </table> <br /> <% act = request.querystring("act") nid = request.querystring("nid") what = request.querystring("what") page = int(request.querystring("page")) select case request.querystring("act") case "all" call so_article_all() case "man" call so_article_man(page) case "add" call so_article_edit("add",0) case "edit" call so_article_edit("edit",nid) case "save" call so_article_save(what,nid) case "delete" call so_article_delete(nid) end select sub so_article_save(what,nid) select case what case "add" sql = "select * from so_article" rs.open sql,conn,2,2 rs.addnew rs("typestr") = "links" case "edit" sql = "select * from so_article where id = "&nid rs.open sql,conn,2,2 end select rs("title") = trim(request.form("title")) rs("page_description") = trim(request.form("page_description")) rs("pic_min") = trim(request.form("pic_min")) rs("url") = trim(request.form("url")) rs("orderid") = trim(request.form("orderid")) rs.update rs.close call redir("?act=man") end sub '编辑表单 sub so_article_edit(act,nid) select case act case "edit" actstr = "编辑" sql = "select * from so_article where id = "&nid rs.open sql,conn,1,1 title = rs("title") page_description = rs("page_description") pic_min = rs("pic_min") url = rs("url") orderid = rs("orderid") rs.close case "add" actstr = "添加" title = "" page_description = "" pic_min = "" url = "http://" orderid = null end select %> <table cellspacing="1"> <thead><tr><th colspan="2"><%=main_title%>——<%=actstr%></th></tr></th> <form method="post" name="add" action="?act=save&what=<%=act%>&nid=<%=nid%>"> <tbody> <tr> <td><b>标题:</b></td> <td><input type="text" name="title" value="<%=title%>" size="26" /></td> </tr> <tr> <td><b>链接地址:</b></td> <td><input type="text" name="url" value="<%=url%>" size="48" /></td> </tr> <tr> <td><b>排序:</b></td> <td><input type="text" name="orderid" value="<%=orderid%>" size="6" /><em>数字越大越靠前</em></td> </tr> <tr> <td><b>描述:</b></td> <td><textarea name="page_description" cols="78" rows="4"><%=page_description%></textarea></td> </tr> <tr> <td><b>logo图片:</b></td> <td><input type="text" name="pic_min" value="<%=pic_min%>" size="36" /> <input type="button" value="上传图片" name="upload" class="button" onclick="window.open('../upload.asp?uppath=<%=server.urlencode("/upload")%>&formname=add&editname=pic_min','upload','width=420,height=100')" /><em>图片大小:宽88像素、高31像素</em></td> </tr> <tr> <td width="20%"></td> <td width="80%"><input type="submit" value="确认提交" /></td> </tr> </tbody> </form> </table> <% end sub '管理列表 sub so_article_man(page) %> <table cellspacing="1"> <thead><tr> <th width="5%">选择</th> <th width="5%">排序</th> <th width="5%">置顶</th> <th width="5%">审核</th> <th width="15%">名称</th> <th width="20%">链接</th> <th width="10%">PageRank</th> <th width="5%">百度</th> <th width="5%">Google</th> <th width="5%">Yahoo</th> <th width="10%">操作</th> </tr></thead> <form action="?act=all" method="post" id="allc"> <% sql = "select * from so_article where typestr = 'links' order by reg_top = 1,orderid desc,id desc" rs.open sql,conn,1,1 if rs.eof then %> <tbody><tr><td align="center" colspan="20">暂无内容!</td></tr></tbody> <% else rs.pagesize = config_manpage if page = 0 then page = 1 if page = "" then page = 1 rs.AbsolutePage = page pagec = rs.pagecount for i = 1 to rs.pagesize if rs("reg_top") = 1 then topstr = "<u>顶</u>" else topstr = "" end if if rs("reg") = 1 then regstr = "<i>过</i>" else regstr = "" end if domain = rs("url") domain = replace(domain,"http://","") domain = replace(domain,"/","") %> <tbody><tr> <td align="center"><input type="checkbox" value="<%=rs("id")%>" name="allid" /></td> <td align="center"><%=rs("orderid")%></td> <td align="center"><%=topstr%></td> <td align="center"><%=regstr%></td> <td><a href="?act=edit&nid=<%=rs("id")%>" class="mod"><%=rs("title")%></a></td> <td><a href="<%=rs("url")%>" target="_blank" class="add"><%=rs("url")%></a></td> <td></td> <td><iframe frameborder="0" height="20" scrolling="no" src="../query/baidu.asp?d=<%=domain%>&s=baidu" width="100%"></iframe></td> <td><iframe frameborder="0" height="20" scrolling="no" src="../query/google.asp?d=<%=domain%>&s=google" width="100%"></iframe></td> <td><iframe frameborder="0" height="20" scrolling="no" src="../query/yahoo.asp?d=<%=domain%>&s=yahoo" width="100%"></iframe></td> <td align="center"> <a href="?act=edit&nid=<%=rs("id")%>" class="mod">编辑</a> <a href="?act=delete&nid=<%=rs("id")%>" class="del" onclick="return del()">删除</a> </td> </tr></tbody> <% rs.movenext if rs.eof then exit for next %> <tbody><tr><td colspan="20"><div id="dispartpage"><%=dispartpage(page,pagec,"act=man&")%></div></td></tr></tbody> <tbody><tr><td colspan="20"> <input type="button" value="全选" name="allid" id="allbtn" /> <select name="opt"> <option value="reg">审核</option> <option value="reg_no">取消审核</option> <option value="top">置顶</option> <option value="top_no">取消置顶</option> <option value="delete">删除</option> </select> <input type="submit" value="批量操作" /> </td></tr></tbody> </form> <% end if rs.close %> </table> <% end sub sub so_article_all() opt = request.form("opt") allid = request.form("allid") select case opt case "delete" conn.execute "delete * from so_article where id in ("&allid&")" case "top" conn.execute "update so_article set reg_top = 1 where id in ("&allid&")" case "top_no" conn.execute "update so_article set reg_top = 0 where id in ("&allid&")" case "reg" conn.execute "update so_article set reg = 1 where id in ("&allid&")" case "reg_no" conn.execute "update so_article set reg = 0 where id in ("&allid&")" end select call redir("?act=man") end sub sub so_article_delete(nid) conn.execute "delete * from so_article where id = "&nid call redir("?act=man") end sub %> <!--#include file="../include/foot.asp"-->