<!--#include file="conn.asp"-->
<!--#include file="inc/cookies_check.asp"-->
<!--#include file="inc/Page_cls.asp"-->
<!--#include file="../include/config.inc"-->
<!--#include file="../include/Lebi_XML_Cls.asp"-->
<%
'*****************************************
'* 软件名称 乐彼网上开店软件(56770 EShop)
'* 软件开发 http://www.56770.com
'* 版权所有 http://www.56770.com
'* 文件名称 Admin_news.asp
'* 最后更新 2013-03-01 by 56770.kingdge
'*****************************************
Set LB_XML = new ASPXML
include "lang/"& LangFilePath &"/lang_sys.inc"
include "lang/"& LangFilePath &"/lang_menu.inc"
include "lang/"& LangFilePath &"/lang_news.inc"
CurrentId = 4
CurrentUrl = "admin_news.asp"
LB_Head()
LB_Menu()
action = request("action")
htmlstate = checknum(request("htmlstate"),1)
%>
<div class="tabmenu mainwidth">
	  <ul>
		<%If action = "skin_modi" Then%>
		<li <%If htmlstate = 0 Then response.write("class=""current""") End If%>><a href="admin_news.asp?action=skin_modi&c_skin=<%=request("c_skin")%>&id=<%=request("id")%>&htmlstate=0"><span><%=Lang_sys(104)%></span></a></li>
		<li <%If htmlstate = 1 Then response.write("class=""current""") End If%>><a href="admin_news.asp?action=skin_modi&c_skin=<%=request("c_skin")%>&id=<%=request("id")%>&htmlstate=1"><span><%=Lang_sys(105)%></span></a></li>
		<%End If%>
		<li <%If action = "" Then Response.Write("class=""current""") End If%>><a href="admin_news.asp"><span><%=Lang_Menu(127)%></span></a></li>
		<li <%If action = "sortlist" Then Response.Write("class=""current""") End If%>><a href="?action=sortlist"><span><%=Lang_Menu(123)%></span></a></li>
		<li <%If action = "sources" Then Response.Write("class=""current""") End If%>><a href="?action=sources"><span><%=Lang_Menu(128)%></span></a></li>
		<li <%If action = "add" Then Response.Write("class=""current""") End If%>><a href="?action=add"><span><%=Lang_Menu(126)%></span></a></li>
	  </ul>
</div>
<%
Response.Write("<div class=""tab-mainbody"">")
Response.Write("<div class=""tab-mainbody2"">")
If OutSubmit = 1 Then CheckOutSubmit()
Select Case action
		Case "add" : add()
		Case "savenews" : savenews()
		Case "newsmodi" : newsmodi()
		Case "modinews" : modinews()
		Case "del" : del()
		Case "classadd" : classadd()
		Case "addclass" : addclass()
		Case "modibig" : modibig()
		Case "bigmodi" : bigmodi()
        Case "delbig" : delbig()
        Case "sortlist" : sortlist()
		Case "up_b" : up_b()
		Case "down_b" : down_b()
		case "skin_modi" : skin_modi()
		case "skin_ok" : skin_ok()
		Case "sources" : sources()
		Case "sources_add" : sources_add()
		Case "sources_add_ok" : sources_add_ok()
		Case "sources_update" : sources_update()
		Case "sources_edit" : sources_edit()
		Case "sources_edit_ok" : sources_edit_ok()
		Case "sources_del" : sources_del()
		Case Else
			list()
End Select
Response.Write("</div>")
Response.Write("</div>")
LB_Footer()

sub savenews
        If OnlyRead = 1 Then OnlyReadMessage()
        Dim admin_flag,pic_src,sources,n_skin
        admin_flag=",5.1,"
        if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
                adminflag()
        Else
                title=Safereplace(trim(request("title"&lang)))
				strcolor=Safereplace(trim(request("strcolor")))
                classid=Replace(Safereplace(trim(request("classid")))," ","")
				sources=Safereplace(trim(request("sources")))
				n_skin=Safereplace(trim(request("n_skin")))
				If request("user_skin")<>1 Then	n_skin=""
                n_pic = CheckNum(request("n_pic"),0)
				pic_src = Safereplace(trim(request("pic_url")))
                n_tj = CheckNum(request("n_tj"),0)
                n_top = CheckNum(request("n_top"),0)
				n_product = CutText(Replace(Replace(safereplace(Trim(Request("n_product")))," ",""),",,",","),0,1)
				If IsNull(n_product) Or IsEmpty(n_product) Then n_product = "0"
				linenum = CheckNum(request("linenum"),2)
				n_filename = ReplaceFolder(safereplace(request("n_filename")))
                If title="" Then
                        is_error = 1
						mes = mes &"·"& Lang_News(3) &"<br />"
                End If
                'If Content_view="" Then
                '        is_error = 1
				'		mes = mes &"·请输入提要信息！"
                'End If
'                If Len(Content_view)>255 Then
'                        is_error = 1
'						mes = mes &"·提要信息不能超过255个字节！"
'                End If
                'If Content="" Then
                '        is_error = 1
				'		mes = mes &"·请输入正文内容！"
                'End If
                If Len(n_product)>150 Then
                        is_error = 1
						mes = mes &"·"& Lang_News(4)
                End If
				If is_error = 1 Then
						Call Up_mes(Lang_sys(46),mes,0,"javascript:history.back()",0,0,2,0)
		        End If
                set rs=server.createobject("adodb.recordset")
                sql="select * from [Lebi_news] where (id is null)"
                rs.open sql, conn, 1, 3
                rs.addnew
				For LangT = 1 To TotalLang
						rs("title" & LanguageTxt(LangT))=safereplace(request("title" & LanguageTxt(LangT)))
						If request("savepic" & LanguageTxt(LangT)) = "1" Then
								FilesPath="../pic/userfiles/image/"
								rs("content" & LanguageTxt(LangT))=ReplaceSaveRemoteFile(Replace(request("content" & LanguageTxt(LangT)),"'","&#180;"),False,True,True,FilesPath,Eshop_url)
								If LangT = 1 Then 
										If n_pic = 1 Then
												pic_src = Replace(GetImg(ReplaceSaveRemoteFile(Replace(request("content" & LanguageTxt(LangT)),"'","&#180;"),False,True,True,FilesPath,Eshop_url),Eshop_url),"src='","")
										End If
								End If 
						Else
								rs("content" & LanguageTxt(LangT))=Replace(request("content" & LanguageTxt(LangT)),"'","&#180;")
								If LangT = 1 Then 
										If n_pic = 1 Then
												pic_src = Replace(GetImg(Replace(request("content" & LanguageTxt(LangT)),"'","&#180;"),Eshop_url),"src='","")
										End If
								End If 
						End If
						rs("content_view" & LanguageTxt(LangT))=Replace(request("content_view" & LanguageTxt(LangT)),"'","&#180;")
						rs("webhead" & LanguageTxt(LangT))=Safereplace(trim(request("webtitle" & LanguageTxt(LangT)))) &"$$$"& Safereplace(trim(request("webkeyword" & LanguageTxt(LangT)))) &"$$$"& Safereplace(trim(request("webdescription" & LanguageTxt(LangT))))
						If LangT = 1 Then 
								If pic_src = "" Then 
										n_pic = 0
								Else
										n_pic = 1
								End If 
						End If 
				Next
                rs("classid")=","& classid &","
                rs("pic_src")=pic_src
                rs("pic")=n_pic
                rs("infotime")=now()
                rs("n_tj")=n_tj
				rs("n_top")=n_top
				rs("n_linenum") = linenum
				rs("n_product") = n_product
				rs("strcolor") = strcolor
				rs("sources") = sources
				rs("n_skin") = n_skin
				rs("hits") = 0
				If n_filename <> "" Then rs("n_filename") = n_filename
                rs.update
                rs.close:set rs=Nothing
				If n_filename = "" Then
						set rs=conn.execute("select top 1 id from [Lebi_news] order by id desc")
						If Not rs.eof Then
								conn.execute("update [Lebi_news] set n_filename = '"& rs(0) &"' where id = "& rs(0) &"")
						End If
						rs.close : Set rs= Nothing
				End If
				If n_skin <> "" Then
						CreateSkinList(n_skin)
				End If
				If Config_Lebi_Eshop(17)="1" Then
						Application.Contents.RemoveAll
				Else
						NewEvent "0"
				End If
				ManageLog Lang_News(5) &" ["&title&"]"
		        If show_html = 1 Then
		                Set rs = conn.execute("select top 1 id from [Lebi_news] order by id desc")
				        id = rs(0)
				        rs.close : Set rs = Nothing
				        html_news="<IFRame name='html_news' frameborder=0 width='350' height=20 scrolling=no src='Plugin/ToHtml/_html_news_list.asp?html_id="& id &"'></IFrame>"
			            m_s_z = "·"& Lang_News(6) & html_news
				Else
				        m_s_z = "0"
		        End If
				If n_skin <> "" Then
						b_u = "admin_news.asp" 'admin_news.asp?action=skin_modi&c_skin=list/"&n_skin
						m_u = "admin_skin_save.asp?action=tpl_news_diy&id="& id &"&mes_type=0&b_u="& server.urlencode(b_u)
						m_s = "·"& Lang_sys(99)
				Else
                        b_u = ""
						m_u = "admin_news.asp"
						m_s = "·"& Lang_sys(44)
				End If
				Call Up_mes(Lang_sys(45),m_s,0,m_u,0,0,2,1)
        end if
end sub

sub modinews
        If OnlyRead = 1 Then OnlyReadMessage()
        Dim admin_flag,pic_src,sources
        admin_flag=",5.2,"
        if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
                adminflag()
        Else
                newsid = CheckNum(request("newsid"),0)
                title = Safereplace(trim(request("title"&lang)))
				strcolor = Safereplace(trim(request("strcolor")))
                classid = Replace(Safereplace(trim(request("classid")))," ","")
				sources = Safereplace(trim(request("sources")))
				n_skin = Safereplace(trim(request("n_skin")))
				user_skin = checknum(request("user_skin"),0)
				If user_skin = 0 Then n_skin = ""
                n_pic = CheckNum(request("n_pic"),0)
				If Not IsNumeric(n_pic) Or IsEmpty(n_pic) Then n_pic = 0
				pic_src = Safereplace(trim(request("pic_url")))
                n_tj = CheckNum(request("n_tj"),0)
                n_top = CheckNum(request("n_top"),0)
				n_product = CutText(Replace(Replace(safereplace(Trim(Request("n_product")))," ",""),",,",","),0,1)
				If IsNull(n_product) Or IsEmpty(n_product) Then n_product = "0"
				linenum = CheckNum(request("linenum"),2)
				n_filename = ReplaceFolder(safereplace(request("n_filename")))
                If title="" Then
                        is_error = 1
						mes = mes &"·"& Lang_News(3) &"<br />"
                End If
                'If Content_view="" Then
                '        is_error = 1
				'		mes = mes &"·请输入提要信息！"
                'End If
'                If Len(Content_view)>255 Then
'                        is_error = 1
'						mes = mes &"·提要信息不能超过255个字节！"
'                End If
                'If Content="" Then
                '        is_error = 1
				'		mes = mes &"·请输入正文内容！"
                'End If
                If Len(n_product)>150 Then
                        is_error = 1
						mes = mes &"·"& Lang_News(4)
                End If
				If is_error = 1 Then
						Call Up_mes(Lang_sys(46),mes,0,"javascript:history.back()",0,0,2,0)
		        End If
                set rs=server.createobject("adodb.recordset")
                sql="select * from [Lebi_news] where id="&newsid&""
                rs.open sql, conn, 1, 3
				For LangT = 1 To TotalLang
						rs("title" & LanguageTxt(LangT))=safereplace(request("title" & LanguageTxt(LangT)))
						If request("savepic" & LanguageTxt(LangT)) = "1" Then
								FilesPath="../pic/userfiles/image/"
								rs("content" & LanguageTxt(LangT))=ReplaceSaveRemoteFile(Replace(request("content" & LanguageTxt(LangT)),"'","&#180;"),False,True,True,FilesPath,Eshop_url)
								If LangT = 1 Then 
										If n_pic = 1 Then
												pic_src = Replace(GetImg(ReplaceSaveRemoteFile(Replace(request("content" & LanguageTxt(LangT)),"'","&#180;"),False,True,True,FilesPath,Eshop_url),Eshop_url),"src='","")
										End If
								End If 
						Else
								rs("content" & LanguageTxt(LangT))=Replace(request("content" & LanguageTxt(LangT)),"'","&#180;")
								If LangT = 1 Then 
										If n_pic = 1 Then
												pic_src = Replace(GetImg(Replace(request("content" & LanguageTxt(LangT)),"'","&#180;"),Eshop_url),"src='","")
										End If
								End If 
						End If
						rs("content_view" & LanguageTxt(LangT))=Replace(request("content_view" & LanguageTxt(LangT)),"'","&#180;")
						rs("webhead" & LanguageTxt(LangT))=Safereplace(trim(request("webtitle" & LanguageTxt(LangT)))) &"$$$"& Safereplace(trim(request("webkeyword" & LanguageTxt(LangT)))) &"$$$"& Safereplace(trim(request("webdescription" & LanguageTxt(LangT))))
						If LangT = 1 Then 
								If pic_src = "" Then 
										n_pic = 0
								Else
										n_pic = 1
								End If 
						End If 
				Next
                rs("classid")=","& classid &","
                rs("pic_src")=pic_src
                rs("pic")=n_pic
                rs("infotime")=now()
                rs("n_tj")=n_tj
				rs("n_top")=n_top
				rs("n_linenum") = linenum
				rs("n_product") = n_product
				rs("strcolor") = strcolor
				rs("sources") = sources
				rs("n_skin") = n_skin
				If n_filename <> "" Then
						rs("n_filename") = n_filename
				Else
						rs("n_filename") = newsid
				End If
                rs.update
                rs.close:set rs=Nothing
				If n_skin <> "" Then
						CreateSkinList(n_skin)
				End If
				If Config_Lebi_Eshop(17)="1" Then
						Application.Contents.RemoveAll
				Else
						NewEvent "0"
				End If
				ManageLog Lang_News(7) &" ["&title&"]"
		        If show_html = 1 Then
				        html_news="<IFRame name='html_news' frameborder=0 width='350' height=20 scrolling=no src='Plugin/ToHtml/_html_news_list.asp?html_id="& newsid &"'></IFrame>"
			            m_s_z = "·"& Lang_News(6) & html_news
				Else
				        m_s_z = "0"
		        End If
				If n_skin <> "" Then
						b_u = "admin_news.asp" 'admin_news.asp?action=skin_modi&c_skin=list/"&n_skin
						m_u = "admin_skin_save.asp?action=tpl_news_diy&id="& newsid &"&mes_type=0"
						m_s = "·"& Lang_sys(99)
						Call Up_mes(Lang_sys(48),m_s,0,m_u&"&b_u="& server.urlencode(b_u),0,0,2,1)
				Else
                        b_u = CheckUrl(request("url"))
						m_u = "admin_news.asp?"
						m_s = "·"& Lang_sys(47)
						Call Up_mes(Lang_sys(48),m_s,0,CheckUrl(request("url")),0,0,2,1)
				End If
        end if
end sub

sub del
        If OnlyRead = 1 Then OnlyReadMessage()
        Dim admin_flag
        admin_flag=",5.3,"
        if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
	            adminflag()
        Else
				del_id= Replace(safereplace(Trim(request("id"))),"，",",")
				If Right(del_id,1) = "," Then del_id = Left(del_id,Len(del_id)-1)
                if del_id="" then
                        response.write"<SCRIPT language=JavaScript>alert('"& Lang_sys(41) &"');javascript:history.go(-1)</SCRIPT>"
                        response.end
                end if
                conn.execute "delete from [Lebi_news] where id in ("&del_id&") "
				If Config_Lebi_Eshop(17)="1" Then
						Application.Contents.RemoveAll
				Else
						NewEvent "0"
				End If
				ManageLog Lang_News(8) &" ["&id&"]"
                m_u="?page="& request("page") &"&ntype="& request("ntype") &"&classid="& request("classid") &"&keyword="& request("keyword") &"&DateFrom="& request("DateFrom") &"&DateTo="& request("DateTo") &"&pagenum="& request("pagenum") &"&lang="&request("lang")
				Call Up_mes(Lang_sys(43),"·"& Lang_sys(42),0,m_u,0,0,2,1)
        end if
end sub

sub delbig
        If OnlyRead = 1 Then OnlyReadMessage()
        Dim admin_flag
        admin_flag=",5.4,"
        if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
                adminflag()
        Else
                classid=CheckNum(Request("classid"),0)
                DeleteClass(classid)
				If Config_Lebi_Eshop(17)="1" Then
						Application.Contents.RemoveAll
				Else
						NewEvent "0"
				End If
				ManageLog Lang_News(9) &" ["&classid&"]"
				Call Up_mes(Lang_sys(43),"·"& Lang_sys(42),0,"?action=sortlist",0,0,2,1)
        end if
end sub

sub addclass
        If OnlyRead = 1 Then OnlyReadMessage()
        Dim admin_flag,ParentID,ClassName,b_order,ClassSkin,sort_id
        admin_flag=",5.4,"
		ParentID=CheckNum(request("ParentID"),0)
		ClassName=Safereplace(request("ClassName"& lang))
		b_order=CheckNum(request("b_order"),0)
		ClassSkin=Safereplace(request("news_skin"))
		If trim(request("user_skin"))<>"1"  Then
				ClassSkin=""
		End If
		n_foldername = ReplaceFolder(safereplace(request("n_foldername")))
		n_filename = ReplaceFolder(safereplace(request("n_filename")))
        if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
                adminflag()
        Else
                Set rs=Server.CreateObject("Adodb.RecordSet")
                rs.open "Select * From [Lebi_newsclass] Where ParentID=" & ParentID & " AND classname='" & ClassName & "'", conn, 1, 3
                If Not (rs.EOF And rs.bof) Then
                        response.write"<SCRIPT language=JavaScript>alert('"& Lang_News(10) &"');javascript:history.go(-1)</SCRIPT>"
						response.End
                Else
                        rs.addnew
						For LangT = 1 To TotalLang
								rs("ClassName" & LanguageTxt(LangT)) = trim(safereplace(request("ClassName" & LanguageTxt(LangT))))
						Next
                        rs("ParentID")=ParentID
						rs("b_order")=b_order
						rs("ClassSkin")=ClassSkin
						rs("n_foldername")=n_foldername
						rs("n_filename")=n_filename
                        rs.update
                        rs.Close : set rs=Nothing
						Set rs = conn.execute("select top 1 classid from [Lebi_newsclass] where ParentID=" & ParentID & " AND classname='" & ClassName & "'")
						If Not rs.eof Then
								sort_id = rs(0)
								If ClassSkin <> "" Then
										CreateSkin(ClassSkin)
								End If
								If n_filename = "" Then conn.execute ("update [Lebi_newsclass] set n_filename='"& sort_id &"' where ParentID=" & ParentID & " AND classname='" & ClassName & "'")
								If n_foldername = "" Then conn.execute ("update [Lebi_newsclass] set n_foldername='"& sort_id &"' where ParentID=" & ParentID & " AND classname='" & ClassName & "'")
						End If
						rs.close : Set rs= Nothing
						If Config_Lebi_Eshop(17)="1" Then
								Application.Contents.RemoveAll
						Else
								NewEvent "0"
						End If
						ManageLog Lang_News(11) &" ["&ClassName&"]"
						m_u = "admin_skin_save.asp?action=tpl_news_class_one&id="& sort_id &"&mes_type=0"
						If ClassSkin <> "" Then
								b_u="admin_news.asp?action=skin_modi&c_skin="&ClassSkin&"&sort_id="&sort_id
						Else
                        		b_u="admin_news.asp?action=sortlist"
						End If
						Call Up_mes(Lang_sys(45),"·"& Lang_sys(99),0,m_u&"&b_u="& server.urlencode(b_u),0,0,2,1)
                end if
        end if
end sub

sub modibig
        If OnlyRead = 1 Then OnlyReadMessage()
        Dim admin_flag,loopid,ClassSkin
        admin_flag=",5.4,"
        if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
                adminflag()
        Else
		        classid=CheckNum(Request("classid"),0)
                ClassName=safereplace(request("ClassName"& lang))
				b_order=CheckNum(request("b_order"),0)
				ParentID=CheckNum(Request("ParentID"),0)
				ClassSkin=safereplace(Request("news_skin"))
				n_foldername = ReplaceFolder(safereplace(request("n_foldername")))
				n_filename = ReplaceFolder(safereplace(request("n_filename")))
				If trim(request("user_skin"))<>"1"  Then
						ClassSkin=""
				End If
'				loopid = ParentID
'				do while loopid <> 0
'						If loopid = classid Then
'								response.write"<SCRIPT language=JavaScript>alert('分类“" & ClassName & "”移动失败!');javascript:history.go(-1)</SCRIPT>"
'                        		response.End
'								Exit sub
'						End If
'						Set rs = conn.execute("Select * From [Lebi_newsclass] Where classid="&loopid)
'                		If Not (rs.bof And rs.EOF) Then
'								loopid = rs("ParentID")
'						Else
'								loopid = 0
'						End If
'                		rs.Close : set rs=Nothing
'				loop
                Set rs=Server.CreateObject("Adodb.RecordSet")
                rs.open "Select * From [Lebi_newsclass] Where classid="&classid&"", conn, 1, 3
                If Not (rs.EOF And rs.bof) Then
						For LangT = 1 To TotalLang
								rs("ClassName" & LanguageTxt(LangT)) = trim(safereplace(request("ClassName" & LanguageTxt(LangT))))
						Next
                        rs("ParentID")=ParentID
						rs("b_order")=b_order
						rs("ClassSkin")=ClassSkin
						rs("n_foldername")=n_foldername
						rs("n_filename")=n_filename
						rs.update
				End If
				rs.Close : set rs=Nothing
				If ClassSkin <> "" Then
						CreateSkin(ClassSkin)
				End If
				If Config_Lebi_Eshop(17)="1" Then
						Application.Contents.RemoveAll
				Else
						NewEvent "0"
				End If
				ManageLog Lang_News(12) &" ["&ClassName&"]"
				m_u = "admin_skin_save.asp?action=tpl_news_class_one&id="& classid &"&mes_type=0"
				b_u="admin_news.asp?action=sortlist"
				Call Up_mes(Lang_sys(48),"·"& Lang_sys(99),0,m_u&"&b_u="& server.urlencode(b_u),0,0,2,1)
        end if
end sub

Sub up_b()
        If OnlyRead = 1 Then OnlyReadMessage()
        classid = request("classid")
		If Not IsNumeric(classid) Or IsEmpty(classid) Then classid = 0
        conn.execute "update [Lebi_newsclass] set b_order=b_order+1 where classid=" & classid
		If Config_Lebi_Eshop(17)="1" Then
				Application.Contents.RemoveAll
		Else
				NewEvent "0"
		End If
		ManageLog Lang_News(13) &" ["&classid&"]"
        response.redirect "?action=sortlist"
        response.end()
End Sub

Sub down_b()
        If OnlyRead = 1 Then OnlyReadMessage()
        classid = CheckNum(request("classid"),0)
        conn.execute "update [Lebi_newsclass] set b_order=b_order-1 where classid=" & classid
		If Config_Lebi_Eshop(17)="1" Then
				Application.Contents.RemoveAll
		Else
				NewEvent "0"
		End If
		ManageLog Lang_News(14) &" ["&classid&"]"
        response.redirect "?action=sortlist"
        response.end()
End Sub

Sub sources_add_ok()
        If OnlyRead = 1 Then OnlyReadMessage()
        admin_flag=",5.5,"
        if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
                adminflag()
        End If
        n_name=safereplace(request("n_name"))
        n_order=CheckNum(request("n_order"),0)
        If n_name = "" Then
		        mes = mes &"·"& Lang_News(15)
				Is_error = 1
		End If
		If Is_error = 1 Then
				Call Up_mes(Lang_sys(46),mes,0,"javascript:history.back()",0,0,2,0)
		End If
        set rs=server.CreateObject("adodb.recordset")
        rs.Open "select * from [Lebi_newssources]", conn, 1, 3
        rs.AddNew
		rs("n_name") = n_name
        rs("n_order")=n_order
        rs.Update
        rs.Close:set rs=Nothing
		ManageLog Lang_News(16) &" ["&n_name&"]"
		Call Up_mes(Lang_sys(45),"·"& Lang_sys(44),0,"?action=sources",0,0,2,1)
End Sub

Sub sources_update()
        If OnlyRead = 1 Then OnlyReadMessage()
        admin_flag=",5.5,"
        if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
                adminflag()
        End If
		n_id=Replace(Safereplace(trim(request("n_id")))," ","")
		n_name=Replace(Safereplace(trim(request("n_name")))," ","")
		n_order=Replace(Safereplace(trim(request("n_order")))," ","")
		If UBound(Split(n_id,",")) =  0 Then
                set rs=server.CreateObject("adodb.recordset")
                rs.open "select * from [Lebi_newssources] where n_id=" &n_id, conn, 1, 3
                        rs("n_name")=n_name
                        rs("n_order")=n_order
                rs.update
                rs.close:set rs=Nothing
		Else
				For i = 0 To UBound(Split(n_id,","))
						set rs=server.CreateObject("adodb.recordset")
						rs.open "select * from [Lebi_newssources] where n_id=" &Split(n_id,",")(i), conn, 1, 3
								rs("n_name")=Split(n_name,",")(i)
								rs("n_order")=Split(n_order,",")(i)
						rs.update
						rs.close:set rs=Nothing
				Next
		End If
		ManageLog Lang_News(17)
		Call Up_mes(Lang_sys(48),"·"& Lang_sys(47),0,"?action=sources",0,0,2,1)
End Sub

Sub sources_edit_ok()
        If OnlyRead = 1 Then OnlyReadMessage()
        admin_flag=",5.5,"
        if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
                adminflag()
        End If
		n_id=Replace(Safereplace(trim(request("n_id")))," ","")
		n_name=Replace(Safereplace(trim(request("n_name")))," ","")
		n_order=Replace(Safereplace(trim(request("n_order")))," ","")
		If UBound(Split(n_id,",")) =  0 Then
                set rs=server.CreateObject("adodb.recordset")
                rs.open "select * from [Lebi_newssources] where n_id=" &n_id, conn, 1, 3
                        rs("n_name")=n_name
                        rs("n_order")=n_order
                rs.update
                rs.close:set rs=Nothing
		Else
				For i = 0 To UBound(Split(n_id,","))
						set rs=server.CreateObject("adodb.recordset")
						rs.open "select * from [Lebi_newssources] where n_id=" &Split(n_id,",")(i), conn, 1, 3
								rs("n_name")=Split(n_name,",")(i)
								rs("n_order")=Split(n_order,",")(i)
						rs.update
						rs.close:set rs=Nothing
				Next
		End If
		ManageLog Lang_News(17)
		Call Up_mes(Lang_sys(48),"·"& Lang_sys(47),0,"?action=sources",0,0,2,1)
End Sub

Sub sources_del()
        If OnlyRead = 1 Then OnlyReadMessage()
        admin_flag=",5.5,"
        if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
                adminflag()
        End If
        del_id= Replace(safereplace(Trim(request("id"))),"，",",")
		If Right(del_id,1) = "," Then del_id = Left(del_id,Len(del_id)-1)
        if del_id="" then
                response.write"<SCRIPT language=JavaScript>alert('"& Lang_sys(41) &"');javascript:history.go(-1)</SCRIPT>"
                response.end
        end if
        conn.execute "delete from [Lebi_newssources] where n_id in("&del_id&")"
		ManageLog Lang_News(18) &" ["&del_id&"]"
		Call Up_mes(Lang_sys(43),"·"& Lang_sys(42),0,"?action=sources",0,0,2,1)
End Sub

sub add
Dim admin_flag
admin_flag=",5.1,"
if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
	adminflag()
Else
rem <-{获取最大ID 2008-6-4 by 56770.kingdge
Set rs = conn.execute("select top 1 id from [Lebi_news] order by id desc")
If Not rs.eof Then
bigid = rs(0) + 1
Else
bigid = 1
End If
rs.close : Set rs = Nothing
rem }->
%>
<script language="vbscript">
function toAsc(str)
        toAsc = hex(asc(str))
end function
</script>
<script language="javascript">
function LebiCopyName(){
var iscopy = document.getElementById('CopyName');
if (iscopy.checked){
document.getElementById('n_filename').value=document.getElementById('title').value;
}
}
function LebiCopyNameToPinYin(){
var iscopy = document.getElementById('CopyNameToPinYin');
if (iscopy.checked){
document.getElementById('n_filename').value=CC2PY(document.getElementById('title').value);
}
}
function CheckForm()
{
	if (CheckEmpty('title<%= LanguageTxt(1) %>')){ShowMessage('title<%= LanguageTxt(1) %>','<%=Lang_News(20)%>');return false;}
	if (CheckEmpty('classid')){ShowMessage('classid','<%=Lang_News(21)%>');return false;}
}
maxLen = 200;
function checkMaxInput(form) {
if (form.content_view.value.length > maxLen)
form.content_view.value = form.content_view.value.substring(0, maxLen);
else form.remLen.value = maxLen - form.content_view.value.length;
}
</script>
<script language="javascript" type="text/javascript" src="inc/js/PinYin.js"></script>
<script language="javascript" type="text/javascript" src="ckeditor/ckeditor.js"></script>
<script language="javascript" type="text/javascript" src="inc/js/dialog.js"></script>
<script language="javascript" type="text/javascript" src="Upfile/js/Upload_Other.js"></script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable">
<form method="post" action="?action=savenews" name="newsinfo" onSubmit="return CheckForm();">
<tr>
	<td height="30" align="left" class="classrow"><input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle"></td>
	<td align="right" class="classrow"><%=QuickMenu("?action=sources|"& Lang_Menu(128) &"","admin_help.asp|"& Lang_Menu(120) &"")%></td>
 </tr>
<tr>
   <td class="classtop" colspan="2" height="30"><%=Lang_News(19)%></td>
 </tr>
	<tr>
	<td class="classbg" colspan="2">
	<ul id="tablist">
	   <%For LangT = 1 To TotalLang%>
	   <li<%If LangT = 1 Then response.write(" class=""selected""") End If%>><a rel="tcontent<%= LangT %>" style="CURSOR:hand;"><%= LanguageName(LangT) %></a></li>
	   <%Next%>
	</ul>
	<div id="tabcontentcontainer">
	<%For LangT = 1 To TotalLang%>
	   <div id="tcontent<%= LangT %>" class="tabcontent">
	   <table cellspacing="0" cellpadding="4" width="100%" border="0" id="classtable_<%= LangT %>">
    <tr class="classrow">
      <td width="15%" height="30" class="classrow"><%=Lang_News(22)%></td>
      <td width="85%" class="classrow"><input id="title<%= LanguageTxt(LangT) %>" name="title<%= LanguageTxt(LangT) %>" type="text" class="form" size="50"> <span id="mes_title<%= LanguageTxt(LangT) %>"></span></td>
    </tr>
    <tr class="classrow">
      <td class="classrow" width="15%" valign="top" style="padding-top:6px;"><%=Lang_News(23)%><br /><em>≤ <span id="remLen<%= LanguageTxt(LangT) %>">255</span></em></td>
      <td class="classrow">
<script type="text/javascript">
function showFCK_view<%= LanguageTxt(LangT) %>(){
	document.getElementById("btn_showFCK_view<%= LanguageTxt(LangT) %>").style.display = 'none' ;
	document.getElementById("ReHeightFCK_view<%= LanguageTxt(LangT) %>").style.display = 'none' ;
	CKEDITOR.replace('content_view<%= LanguageTxt(LangT) %>',{height:100});
	CKFinder.SetupCKEditor(editor, 'ckfinder/'); 
}
</script>
<textarea wrap="physical" name="content_view<%= LanguageTxt(LangT) %>" id="content_view<%= LanguageTxt(LangT) %>" rows="6" cols="80" onKeyDown="checkMaxInput<%= LanguageTxt(LangT) %>(this.form)" onKeyUp="checkMaxInput<%= LanguageTxt(LangT) %>(this.form)" class="text"></textarea>
<span id="btn_showFCK_view<%= LanguageTxt(LangT) %>"><br /><input type="button" value="<%=Lang_sys(65)%>" onclick="showFCK_view<%= LanguageTxt(LangT) %>()" class="button"></span>
<span id="ReHeightFCK_view<%= LanguageTxt(LangT) %>"><a href="javascript:u_Size(-10,'content_view<%= LanguageTxt(LangT) %>')"><img src="lang/<%=LangFilePath%>/images/tab/bt_close.gif" border='0'></a>&nbsp;<a href="javascript:u_Size(10,'content_view<%= LanguageTxt(LangT) %>')"><img src="lang/<%=LangFilePath%>/images/tab/bt_open.gif" border='0'></a></span>
<%If Config_Lebi_Eshop(19) = "0" Then%><script>showFCK_view<%= LanguageTxt(LangT) %>()</script><%End If%>
<script type="text/javascript">
var maxLen<%= LanguageTxt(LangT) %> = 255;
var content_view<%= LanguageTxt(LangT) %> = document.getElementById("content_view<%= LanguageTxt(LangT) %>");
function checkMaxInput<%= LanguageTxt(LangT) %>(form) {
if (content_view<%= LanguageTxt(LangT) %>.value.length > maxLen<%= LanguageTxt(LangT) %>)
content_view<%= LanguageTxt(LangT) %>.value = content_view<%= LanguageTxt(LangT) %>.value.substring(0, maxLen<%= LanguageTxt(LangT) %>);
else document.getElementById("remLen<%= LanguageTxt(LangT) %>").innerHTML = maxLen<%= LanguageTxt(LangT) %> - content_view<%= LanguageTxt(LangT) %>.value.length;
}
</script>
</td>
    </tr>
    <tr class="classrow">
      <td class="classrow" width="15%" valign="top" style="padding-top:6px;"><%=Lang_News(24)%><div class="autosave"><span id="timemsg<%= LanguageTxt(LangT) %>"></span><br><span id="msg2<%= LanguageTxt(LangT) %>"></span><br><span id="msg<%= LanguageTxt(LangT) %>"></span></div><div class="autosave"><input type="checkbox" name="savepic<%= LanguageTxt(LangT) %>" value="1"><%=Lang_sys(71)%></div></td>
      <td class="classrow" width="85%">
<script type="text/javascript">
function showFCK<%= LanguageTxt(LangT) %>(){
	document.getElementById("btn_showFCK<%= LanguageTxt(LangT) %>").style.display = 'none' ;
	document.getElementById("ReHeightFCK<%= LanguageTxt(LangT) %>").style.display = 'none' ;
	CKEDITOR.replace('content<%= LanguageTxt(LangT) %>',{height:300});
	CKFinder.SetupCKEditor(editor, 'ckfinder/');
}
</script>
<textarea name="content<%= LanguageTxt(LangT) %>" id="content<%= LanguageTxt(LangT) %>" rows="12" cols="80" class="text"></textarea>
<span id="btn_showFCK<%= LanguageTxt(LangT) %>"><br /><input type="button" value="<%=Lang_sys(65)%>" onclick="showFCK<%= LanguageTxt(LangT) %>()" class="button"></span>
<span id="ReHeightFCK<%= LanguageTxt(LangT) %>"><a href="javascript:u_Size(-10,'content<%= LanguageTxt(LangT) %>')"><img src="lang/<%=LangFilePath%>/images/tab/bt_close.gif" border='0'></a>&nbsp;<a href="javascript:u_Size(10,'content<%= LanguageTxt(LangT) %>')"><img src="lang/<%=LangFilePath%>/images/tab/bt_open.gif" border='0'></a></span>
<%If Config_Lebi_Eshop(19) = "0" Then%><script>showFCK<%= LanguageTxt(LangT) %>()</script><%End If%>
<SCRIPT LANGUAGE="JavaScript" src="Admin_autosave.asp?act=edit&type=news<%= LanguageTxt(LangT) %>&Lang=<%= LanguageTxt(LangT) %>"></SCRIPT>
</td>
    </tr>
<tr>
   <td class="classtop" height="30" colspan="2"><%=Lang_sys(73)%></td>
 </tr>
    <tr class="classrow">
      <td height="30" class="classrow"><%=Lang_sys(74)%></td>
      <td class="classrow"><input name="webtitle<%= LanguageTxt(LangT) %>" type="text" class="form" size="50"></td>
    </tr>
    <tr class="classrow">
      <td height="30" class="classrow"><%=Lang_sys(75)%></td>
      <td class="classrow"><input name="webkeyword<%= LanguageTxt(LangT) %>" type="text" class="form" size="90"></td>
    </tr>
    <tr class="classrow">
      <td height="30" class="classrow"><%=Lang_sys(76)%></td>
      <td class="classrow"><input name="webdescription<%= LanguageTxt(LangT) %>" type="text" class="form" size="90"></td>
    </tr>
		</table>
		</div>
		<script>tdshow("classtable_<%= LangT %>");</script>
	<%Next%>
	</div>
	<script>showtabcontent("tablist")</script>
	<ul id="tablistmain">
	   <li class="selected"><a rel=""><%=Lang_sys(66)%></a></li>
	</ul>
	<div id="tabcontentcontainer">
	<table cellspacing="0" cellpadding="4" width="100%" border="0" id="classtable">
		<tr class="classrow">
		  <td width="15%" height="30" class="classrow"><%=Lang_News(26)%></td>
		  <td class="classrow"><input id="strcolor" name="strcolor" type="text" size="7" value="" class="form"> <img id="s_strcolor" border="0" src="Images/rect.gif" width="18" align="absmiddle" onclick="colorcd('newsinfo','strcolor','strcolor')" style="cursor:pointer;"></td>
      <td class="classrow" rowspan="5" width="28%">
	  <div style="width:100%;border-left:#CCC 1px solid;background:#FAFAFA;text-align:center">
	  <%=Lang_News(27)%> <span id="mes_classid"></span><br />
	   <select id="classid" name="classid" size="8" multiple="multiple" style="width:200px;"><%
	   OptionClass 0,0,0
	   %></select></div></td>
		</tr>
		 <tr class="classrow">
		  <td height="30" class="classrow"><%=Lang_News(28)%></td>
		  <td class="classrow"><input id="sources" name="sources" type="text" class="form" size="20" value="<%=Lang_News(29)%>">
		  <select name="selectsources" onChange='sources.value=this.options[this.selectedIndex].value;'>
		  <option value="">┌ <%=Lang_sys(50)%></option>
	<%
	Set Rs=conn.execute("select n_name from [lebi_newssources] order by n_order desc")
	Do While Not Rs.Eof
			Response.Write "<option value='"&Rs(0)&"'>├ "&Rs(0)&"</option>"
			Rs.MoveNext
	Loop
	Rs.close : Set Rs=Nothing
	%>
	</select>
		  </td>
		</tr>
		<tr class="classrow">
		  <td height="30" class="classrow"><%=Lang_News(30)%></td>
		  <td class="classrow"><input name="n_top" type="checkbox" value="1"> <%=Lang_News(46)%>
		  <input name="n_tj" type="checkbox" value="1"> <%=Lang_News(47)%>
		  </td>
		</tr>
		<tr class="classrow">
		  <td height="30" class="classrow"><%=Lang_News(31)%></td>
		  <td class="classrow"><table cellspacing="0" cellpadding="0"><tr><td><input type="radio" name="n_pic" value="1" onclick="document.getElementById('$_pic').style.display='none';" title="<%=Lang_News(48)%>" checked /> <%=Lang_News(49)%>
		  <input type="radio" name="n_pic" value="0" onclick="document.getElementById('$_pic').style.display='block';" /> <%=Lang_News(50)%></td>
		  <td id="$_pic" style="padding-left:5px;display:none"><%=Lang_News(32)%><input type="text" id="pic_url" name="pic_url" class="form" value="" size="20"> <input type="button" id="Upload_pic_url" name="Submit" value="<%=Lang_sys(52)%>" onclick="uploadpanel('newsinfo','pic_url','news')" class="btn_upload"> </td></tr></table>
		  </td>
		</tr>
		 <tr class="classrow">
		  <td height="30" class="classrow"><%=Lang_News(33)%></td>
		  <td class="classrow"><table cellspacing="0" cellpadding="0"><tr><td><input type="radio" name="user_skin" value="1" onclick="document.getElementById('$_skin').style.display='block';" /> <%=Lang_News(51)%>
		  <input type="radio" name="user_skin" value="0" onclick="document.getElementById('$_skin').style.display='none';" checked /> <%=Lang_News(52)%></td>
		  <td id="$_skin" style="padding-left:5px;display:none"><%=Lang_News(34)%><input type="text" name="n_skin" class="form" value="Lebi.NewsList<%=bigid%>.style" size="41"></td></tr></table></td>
		</tr>
		</table>
		<table cellspacing="0" cellpadding="4" width="100%" border="0">
		<tr>
		   <td class="classtop" height="30"><%=Lang_News(35)%></td>
		 </tr>
		</table>
		<table cellspacing="0" cellpadding="3" width="100%" border="0">
		<tr>
		<td class="classrow">
		<table border="0" cellspacing="0" cellpadding="3">
		<tr>
		<td height="30" align="left">
		<select id="s_sort_id" name="s_sort_id">
		<option value="0" selected>┌ <%=Lang_News(36)%></option>
		<script src="../include/Lebi_html/CategoryOption.js"></script>
		</select></td>
		<td height="30" align="left">
		<input type="text" name="s_keywords" id="s_keywords" class="form_query" size="20"><input name="Submit" type="button" onClick="callsearch();return false;" title="<%=Lang_sys(25)%>" value="" class="btn_query">
		</td>
		</tr>
		</table>
		</td>
		<td  class="classrow" align="right">&nbsp;
		<!--<input type="text" name="linenum" value="4" style="width:30px;" class="form" onkeyup="value=value.replace(/[^\d\.]/g,'');"><%=Lang_News(38)%>-->
		</td>
		 </tr>
		</table>
		<table cellspacing="0" cellpadding="4" width="720" border="0">
		<tr>
		<td>
		<table border="0" cellspacing="0" cellpadding="3" align="center" width="100%">
		<tr>
		<td class="classrow">
		<span id="test1">
		<select multiple size="10" id="temp_product" name="temp_product" style="width:340px;">
		<option value=""><%=Lang_News(37)%></option>
		</select>
		</span>
		</td>
		<td class="classrow" align="center" valign="middle">
		<input type="button" onClick="move(document.getElementById('get_product'),document.getElementById('temp_product'))" value="<%=Lang_News(44)%>" class="button"><br><br>
		<input type="button" onClick="move(document.getElementById('temp_product'),document.getElementById('get_product'))" value="<%=Lang_News(45)%>" class="button">
		</td>
		<td class="classrow">
		<input type="hidden" id="n_product" name="n_product" value="0">
		<select multiple size="10" id="get_product" name="get_product" style="width:340px;">
		</select>
		</td>
		</tr>
		</table>
		</td>
		</tr>
		</table>
		<table border="0" cellspacing="0" cellpadding="3" align="center" width="100%">
		<tr><td height="30" class="classtop" colspan="2"><%=Lang_News(39)%></td></tr>
		<tr class="classrow">
		<td height="30" width="15%" class="classrow"><%=Lang_News(40)%></td>
		<td class="classrow">
		<input name="n_filename" id="n_filename" value="" type="text" maxlength="250" class="form" size="50"> <img src="images/help.gif" align="absmiddle" onmouseover="showhintinfo(this,0,0,'','<%=Lang_News(43)%>','50','up');" onmouseout="hidehintinfo();" /> <input type="checkbox" onclick="LebiCopyName();" name="CopyName" value="1" > <%=Lang_News(41)%> <input type="checkbox" onclick="LebiCopyNameToPinYin();" name="CopyNameToPinYin" value="1" > <%=Lang_News(42)%>
		</td>
		</tr>
		</table>
		</div>
		<script>tdshow("classtable");</script>
	</td>
	</tr>
    <tr>
      <td height="30" colspan="2" align="left" class="classfooter">
        <input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle">
      </td>
    </tr>
  </form>
</table>
<%
end if
end Sub

sub newsmodi
Dim admin_flag,n_skin
admin_flag=",5.2,"
if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
	adminflag()
Else
newsid=CheckNum(request("id"),0)
Set rso=conn.execute("select * from [Lebi_news] where id="&newsid)
if rso.eof and rso.bof then
        response.Write("没有记录")
else
n_skin=rso("n_skin")
%>
<script language="vbscript">
function toAsc(str)
        toAsc = hex(asc(str))
end function
</script>
<script language="javascript">
function LebiCopyName(){
var iscopy = document.getElementById('CopyName');
if (iscopy.checked){
document.getElementById('n_filename').value=document.getElementById('title').value;
}
}
function LebiCopyNameToPinYin(){
var iscopy = document.getElementById('CopyNameToPinYin');
if (iscopy.checked){
document.getElementById('n_filename').value=CC2PY(document.getElementById('title').value);
}
}
function CheckForm()
{
	if (CheckEmpty('title<%= LanguageTxt(1) %>')){ShowMessage('title<%= LanguageTxt(1) %>','<%=Lang_News(20)%>');return false;}
	if (CheckEmpty('classid')){ShowMessage('classid','<%=Lang_News(21)%>');return false;}
}
</script>
<script language="javascript" type="text/javascript" src="inc/js/PinYin.js"></script>
<script language="javascript" type="text/javascript" src="ckeditor/ckeditor.js"></script>
<script language="javascript" type="text/javascript" src="inc/js/dialog.js"></script>
<script language="javascript" type="text/javascript" src="Upfile/js/Upload_Other.js"></script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable">
<form method="post" action="?action=modinews" name="newsinfo" onSubmit="return CheckForm();">
<tr>
	<td height="30" align="left" class="classhead"><input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle"></td>
	<td align="right" class="classhead">
	<%=QuickMenu("","")%>
	</td>
  <input type="hidden" name="newsid" value="<%= newsid %>">
  <input type="hidden" name="url" value="<%= request("url") %>">
 </tr>
<tr>
   <td class="classtop" colspan="2" height="30"><%=Lang_News(53)%></td>
 </tr>
 	<tr>
	<td class="classbg" colspan="2">
	<ul id="tablist">
	   <%For LangT = 1 To TotalLang%>
	   <li<%If LangT = 1 Then response.write(" class=""selected""") End If%>><a rel="tcontent<%= LangT %>" style="CURSOR:hand;"><%= LanguageName(LangT) %></a></li>
	   <%Next%>
	</ul>
	<div id="tabcontentcontainer">
	<%
	For LangT = 1 To TotalLang
	webhead = rso("webhead"& LanguageTxt(LangT))
	If IsNull(webhead) Or InStr(webhead,"$$$") = 0 Then webhead = "$$$$$$$$$"& webhead
	%>
	   <div id="tcontent<%= LangT %>" class="tabcontent">
	   <table cellspacing="0" cellpadding="4" width="100%" border="0" id="classtable_<%= LangT %>">
		<tr class="classrow">
		<td width="15%" height="30" class="classrow"><%=Lang_News(22)%></td>
		<td class="classrow"><input id="title<%= LanguageTxt(LangT) %>" name="title<%= LanguageTxt(LangT) %>" type="text" class="form" value="<%=rso("title"& LanguageTxt(LangT))%>" size="50"> <span id="mes_title<%= LanguageTxt(LangT) %>"></span></td>
		</tr>
		<tr class="classrow">
		<td class="classrow" width="15%" valign="top" style="padding-top:6px;"><%=Lang_News(23)%><br /><em>≤ <span id="remLen<%= LanguageTxt(LangT) %>">255</span></em></td>
		 <td class="classrow">
<script type="text/javascript">
function showFCK_view<%= LanguageTxt(LangT) %>(){
	document.getElementById("btn_showFCK_view<%= LanguageTxt(LangT) %>").style.display = 'none' ;
	document.getElementById("ReHeightFCK_view<%= LanguageTxt(LangT) %>").style.display = 'none' ;
	CKEDITOR.replace('content_view<%= LanguageTxt(LangT) %>',{height:100});
	CKFinder.SetupCKEditor(editor, 'ckfinder/'); 
}
</script>
<textarea wrap="physical" name="content_view<%= LanguageTxt(LangT) %>" id="content_view<%= LanguageTxt(LangT) %>" rows="6" cols="80" onKeyDown="checkMaxInput<%= LanguageTxt(LangT) %>(this.form)" onKeyUp="checkMaxInput<%= LanguageTxt(LangT) %>(this.form)" class="text"><%= rso("content_view"& LanguageTxt(LangT)) %></textarea>
<span id="btn_showFCK_view<%= LanguageTxt(LangT) %>"><br /><input type="button" value="<%=Lang_sys(65)%>" onclick="showFCK_view<%= LanguageTxt(LangT) %>()" class="button"></span>
<span id="ReHeightFCK_view<%= LanguageTxt(LangT) %>"><a href="javascript:u_Size(-10,'content_view<%= LanguageTxt(LangT) %>')"><img src="lang/<%=LangFilePath%>/images/tab/bt_close.gif" border='0'></a>&nbsp;<a href="javascript:u_Size(10,'content_view<%= LanguageTxt(LangT) %>')"><img src="lang/<%=LangFilePath%>/images/tab/bt_open.gif" border='0'></a></span>
<%If Config_Lebi_Eshop(19) = "0" Then%><script>showFCK_view<%= LanguageTxt(LangT) %>()</script><%End If%>
<script type="text/javascript">
var maxLen<%= LanguageTxt(LangT) %> = 255;
var content_view<%= LanguageTxt(LangT) %> = document.getElementById("content_view<%= LanguageTxt(LangT) %>");
function checkMaxInput<%= LanguageTxt(LangT) %>(form) {
if (content_view<%= LanguageTxt(LangT) %>.value.length > maxLen<%= LanguageTxt(LangT) %>)
content_view<%= LanguageTxt(LangT) %>.value = content_view<%= LanguageTxt(LangT) %>.value.substring(0, maxLen<%= LanguageTxt(LangT) %>);
else document.getElementById("remLen<%= LanguageTxt(LangT) %>").innerHTML = maxLen<%= LanguageTxt(LangT) %> - content_view<%= LanguageTxt(LangT) %>.value.length;
}
</script>
		 </td>
		</tr>
		<tr class="classrow">
		<td class="classrow" valign="top" style="padding-top:6px;"><%=Lang_News(24)%><div class="autosave"><span id="timemsg<%= LanguageTxt(LangT) %>"></span><br><span id="msg2<%= LanguageTxt(LangT) %>"></span><br><span id="msg<%= LanguageTxt(LangT) %>"></span></div><div class="autosave"><input type="checkbox" name="savepic<%= LanguageTxt(LangT) %>" value="1"><%=Lang_sys(71)%></div>
		</td>
		 <td class="classrow" colspan="2">
<script type="text/javascript">
function showFCK<%= LanguageTxt(LangT) %>(){
	document.getElementById("btn_showFCK<%= LanguageTxt(LangT) %>").style.display = 'none' ;
	document.getElementById("ReHeightFCK<%= LanguageTxt(LangT) %>").style.display = 'none' ;
	CKEDITOR.replace('content<%= LanguageTxt(LangT) %>',{height:300});
	CKFinder.SetupCKEditor(editor, 'ckfinder/'); 
}
</script>
<textarea name="content<%= LanguageTxt(LangT) %>" id="content<%= LanguageTxt(LangT) %>" rows="12" cols="80" class="text"><%= rso("content"& LanguageTxt(LangT)) %></textarea>
<span id="btn_showFCK<%= LanguageTxt(LangT) %>"><br /><input type="button" value="<%=Lang_sys(65)%>" onclick="showFCK<%= LanguageTxt(LangT) %>()" class="button"></span>
<span id="ReHeightFCK<%= LanguageTxt(LangT) %>"><a href="javascript:u_Size(-10,'content<%= LanguageTxt(LangT) %>')"><img src="lang/<%=LangFilePath%>/images/tab/bt_close.gif" border='0'></a>&nbsp;<a href="javascript:u_Size(10,'content<%= LanguageTxt(LangT) %>')"><img src="lang/<%=LangFilePath%>/images/tab/bt_open.gif" border='0'></a></span>
<%If Config_Lebi_Eshop(19) = "0" Then%><script>showFCK<%= LanguageTxt(LangT) %>()</script><%End If%>
<SCRIPT LANGUAGE="JavaScript" src="Admin_autosave.asp?act=edit&type=news<%= LanguageTxt(LangT) %>&Lang=<%= LanguageTxt(LangT) %>"></SCRIPT>
		 </td>
		</tr>
		<tr>
		   <td class="classtop" height="30" colspan="2"><%=Lang_sys(73)%></td>
		 </tr>
			<tr class="classrow">
			  <td height="30" class="classrow"><%=Lang_sys(74)%></td>
			  <td class="classrow"><input name="webtitle<%= LanguageTxt(LangT) %>" type="text" value="<%=Split(webhead,"$$$")(0)%>" class="form" size="50"></td>
			</tr>
			<tr class="classrow">
			  <td height="30" class="classrow"><%=Lang_sys(75)%></td>
			  <td class="classrow"><input name="webkeyword<%= LanguageTxt(LangT) %>" type="text" value="<%=Split(webhead,"$$$")(1)%>" class="form" size="90"></td>
			</tr>
			<tr class="classrow">
			  <td height="30" class="classrow"><%=Lang_sys(76)%></td>
			  <td class="classrow"><input name="webdescription<%= LanguageTxt(LangT) %>" type="text" value="<%=Split(webhead,"$$$")(2)%>" class="form" size="90"></td>
			</tr>
		</table>
		</div>
		<script>tdshow("classtable_<%= LangT %>");</script>
	<%Next%>
	</div>
	<script>showtabcontent("tablist")</script>
	<ul id="tablistmain">
	   <li class="selected"><a rel=""><%=Lang_sys(66)%></a></li>
	</ul>
	<div id="tabcontentcontainer">
	<table cellspacing="0" cellpadding="3" width="100%" border="0" id="classtable">
		<tr class="classrow">
		<td height="30" class="classrow"><%=Lang_News(26)%></td>
		<td class="classrow" width="57%"><input id="strcolor" name="strcolor" type="text" size="7" value="<%=rso("strcolor")%>" class="form"> <img id="s_strcolor" border="0" src="Images/rect.gif" width="18" align="absmiddle" onclick="colorcd('newsinfo','strcolor','strcolor')" style="cursor:pointer;background:<%=rso("strcolor")%>"></td>
		<td class="classrow" rowspan="5" width="28%">
		<div style="width:100%;border-left:#CCC 1px solid;background:#FAFAFA;text-align:center">
			   <%=Lang_News(27)%> <span id="mes_classid"></span><br />
			   <select id="classid" name="classid" size="8" multiple="multiple" style="width:180px;"><%
			   OptionClass 0,0,rso("classid")
			   %></select></div></td>
		</tr>
		<tr class="classrow">
			  <td height="30" class="classrow"><%=Lang_News(28)%></td>
			  <td class="classrow">
			  <input id="sources" name="sources" type="text" class="form" size="20" value="<%=trim(rso("sources"))%>">
			  <select name="selectsources" onChange='sources.value=this.options[this.selectedIndex].value;'>
		<%
		Set Rs=conn.execute("select n_name from [Lebi_newssources] order by n_order desc")
		Do While Not Rs.Eof
				Response.Write "<option value='"&Rs(0)&"'>"&Rs(0)&"</option>"
				Rs.MoveNext
		Loop
		Rs.close : Set Rs=Nothing
		%>
		</select>
			  </td>
			</tr>
		<tr class="classrow">
		<td height="30" class="classrow"><%=Lang_News(30)%></td>
		 <td class="classrow"><input name="n_top" type="checkbox" value="1" <%if rso("n_top")="1" then Response.Write"checked" %>> <%=Lang_News(46)%>
		 <input name="n_tj" type="checkbox" value="1" <%if rso("n_tj")="1" then Response.Write"checked" %>> <%=Lang_News(47)%></td>
		</tr>
		<tr class="classrow">
		<td height="30" class="classrow"><%=Lang_News(31)%></td>
		 <td class="classrow"><table cellspacing="0" cellpadding="0"><tr><td><input type="radio" name="n_pic" value="1" onclick="document.getElementById('$_pic').style.display='none';" title="<%=Lang_News(48)%>" checked /> <%=Lang_News(49)%>
		 <input type="radio" name="n_pic" value="0" <%if trim(rso("pic_src"))<>"" then Response.Write"checked" %> onclick="document.getElementById('$_pic').style.display='block';" /> <%=Lang_News(50)%></td>
		  <td id="$_pic" style="padding-left:5px;display:<%if trim(rso("pic_src"))="" then Response.Write"none" %>"><%=Lang_News(32)%><input type="text" id="pic_url" name="pic_url" class="form" value="<%=trim(rso("pic_src"))%>" size="20"> <input type="button" id="Upload_pic_url" name="Submit" value="<%=Lang_sys(52)%>" onclick="uploadpanel('newsinfo','pic_url','news')" class="btn_upload"> </td></tr></table></td>
		</tr>
		<tr class="classrow">
		<td height="30" class="classrow"><%=Lang_News(33)%></td>
		<td class="classrow"><table cellspacing="0" cellpadding="0"><tr><td><input type="radio" name="user_skin" value="1" onclick="document.getElementById('$_skin').style.display='block';" <% If n_skin<>"" Then Response.Write("checked") %>/> <%=Lang_News(51)%>
		<input type="radio" name="user_skin" value="0" onclick="document.getElementById('$_skin').style.display='none';" <% If n_skin="" Or IsNull(n_skin) Then Response.Write("checked") %> /> <%=Lang_News(52)%></td>
		<td id="$_skin" style="padding-left:5px;display:<% If n_skin="" Or IsNull(n_skin) Then Response.Write("none") %>"><%=Lang_News(34)%><input type="text" name="n_skin" class="form" value="<% If n_skin="" Or IsNull(n_skin) Then : Response.Write("Lebi.NewsList"&rso("id")&".style") : Else : Response.Write(n_skin) : End If%>" size="41"></td></tr></table>
		</td>
		</tr>
		<table>
		<table cellspacing="0" cellpadding="3" width="100%" border="0">
		<tr>
		   <td class="classtop" height="30"><%=Lang_News(35)%></td>
		 </tr>
		</table>
		<table cellspacing="0" cellpadding="3" width="100%" border="0">
		<tr>
		<td class="classrow">
		<table border="0" cellspacing="0" cellpadding="3">
		<tr>
		<td height="30" align="left">
		<select id="s_sort_id" name="s_sort_id">
		<option value="0" selected>┌ <%=Lang_News(36)%></option>
		<script src="../include/Lebi_html/CategoryOption.js"></script>
		</select></td>
		<td height="30" align="left">
		<input type="text" name="s_keywords" id="s_keywords" class="form_query" size="20"><input name="Submit" type="button" onClick="callsearch();return false;" title="<%=Lang_sys(25)%>" value="" class="btn_query">
		</td>
		</tr>
		</table>
		</td>
		<td class="classrow" align="right">&nbsp;
		<!--<input type="text" name="linenum" value="<%= rso("n_linenum") %>" style="width:30px;" class="form" onkeyup="value=value.replace(/[^\d\.]/g,'');"><%=Lang_News(38)%>-->
		</td>
		 </tr>
		</table>
		<table cellspacing="0" cellpadding="3" width="720" border="0">
		<tr>
		<td>
		<table border="0" cellspacing="0" cellpadding="3" align="center" width="100%">
		<tr>
		<td class="classrow">
		<span id="test1">
		<select multiple size="10" id="temp_product" name="temp_product" style="width:330px;">
		<option value=""><%=Lang_News(37)%></option>
		</select>
		</span>
		</td>
		<td class="classrow" align="center" valign="middle">
		<input type="button" onClick="move(document.getElementById('get_product'),document.getElementById('temp_product'))" value="<%=Lang_News(44)%>" class="button"><br><br>
		<input type="button" onClick="move(document.getElementById('temp_product'),document.getElementById('get_product'))" value="<%=Lang_News(45)%>" class="button">
		</td>
		<td class="classrow">
		<input type="hidden" id="n_product" name="n_product" value="<%= rso("n_product") %>,">
		<select multiple size="10" id="get_product" name="get_product" style="width:330px;">
		<%
		If rso("n_product") <> "0" And rso("n_product") <> "" Then
				Set rs = conn.execute("select id,product_name from [Lebi_product] where id in ("& rso("n_product") &")")
				Do While Not rs.eof
						response.write("<option value="""& rs(0) &""">"& rs(1) &"</option>")
				rs.movenext
				Loop
				rs.close : Set rs = Nothing
		End If
		%>
		</select>
		</td>
		</tr>
		</table>
		</td>
		</tr>
	</table>
		<table border="0" cellspacing="0" cellpadding="3" align="center" width="100%">
		<tr><td height="30" class="classtop" colspan="2"><%=Lang_News(39)%></td></tr>
		<tr class="classrow">
		<td height="30" width="15%" class="classrow"><%=Lang_News(40)%></td>
		<td class="classrow">
		<input name="n_filename" id="n_filename" value="<%=rso("n_filename")%>" type="text" maxlength="250" class="form" size="50"> <img src="images/help.gif" align="absmiddle" onmouseover="showhintinfo(this,0,0,'','<%=Lang_News(43)%>','50','up');" onmouseout="hidehintinfo();" /> <input type="checkbox" onclick="LebiCopyName();" name="CopyName" value="1" > <%=Lang_News(41)%> <input type="checkbox" onclick="LebiCopyNameToPinYin();" name="CopyNameToPinYin" value="1" > <%=Lang_News(42)%>
		</td>
		</tr>
		</table>
	</div>
	<script>tdshow("classtable");</script>
    <tr>
      <td height="30" colspan="2" align="left" class="classfooter">
        <input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" value=" <%=Lang_sys(1)%> " title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle">
      </td>
    </tr>
  </form>
</table>
<% End If
rso.close
set rso=nothing
end if
end sub

sub list()
		Dim admin_flag
		admin_flag=",5.2,"
		if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
				adminflag()
		End If
		classid = CheckNum(request("classid"),0)
		ntype = CheckNum(request("ntype"),0)
		page = CheckNum(request("page"),1)
		pagenum = CheckNum(request("pagenum"),15)
		datefrom = safeReplace(request("datefrom"))
		dateto = safeReplace(request("dateto"))
		state = safeReplace(request("state"))
		keyword = safeReplace(request("keyword"))
		lang = safereplace(request("lang"))
		If lang = "" Then lang = LanguageTxt(0)
		Dim ors
		Set ors=new Cls_vbsPage
		Set ors.Conn=conn
		With ors
		.PageSize=pagenum
		.PageName="Page"
		If IsSqlDataBase = 0 Then
				.DbType="AC"
		Else
				.DbType="MSSQL"
		End If
		.RecType=-1
		.Pkey="id"
		.Field="id,strcolor,title"& lang &",pic,n_top,n_tj,infotime,n_skin,hits"
		.Table="[Lebi_news]"
		sql = "1=1"
		If keyword <> "" Then sql = sql &" and title"& lang &" like '%"& keyword &"%'"
		If ntype = 1 Then sql = sql &" and n_top = 1"
		If ntype = 2 Then sql = sql &" and n_tj = 1"
		If ntype = 3 Then sql = sql &" and pic = 1"
		If classid<>0 And IsSqlDataBase ="1" Then sql = sql &" and charindex(',"&classid&",',classid)>0"
		If classid<>0 And IsSqlDataBase ="0" Then sql = sql &" and instr(classid,',"&classid&",')>0"
		If IsSqlDataBase = 1 And datefrom<>"" And dateto<>"" Then sql=sql + " and DateDiff(d,infotime,'"& datefrom &"')<=0 and DateDiff(d,infotime,'"& dateto &"')>=0"
		If IsSqlDataBase = 0 And datefrom<>"" And dateto<>"" Then sql=sql + " and DateDiff('d',infotime,'"& datefrom &"')<=0 and DateDiff('d',infotime,'"& dateto &"')>=0"
		.Condition=sql
		.OrderBy="infotime desc"
		End With
		DataCount=ors.RecCount()
		DataList=ors.ResultSet()
%>
<script language="javascript" src="inc/js/MyCalendar.js"></script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable-top">
<tbody>
<tr>
<form name="form" action="?" method="get">
<td height="30" align="left" class="classhead">
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<select name="lang">
<option value="0" selected>┌ <%=Lang_sys(67)%></option>
<%For LangT = 1 To TotalLang%>
<option value="<%= LanguageTxt(LangT) %>"<%=judge2(LanguageTxt(LangT),Lang)%>>├ <%= LanguageName(LangT) %></option>
<%Next%>
</select>
<select name="classid">
<option value="0">┌ <%=Lang_News(54)%></option>
<% OptionClass 0,0,","&classid&"," %>
</select>
<select name="ntype">
<option value="0">┌ <%=Lang_News(55)%></option>
<option value="0" <%=judge2(ntype,0)%>>├ <%=Lang_News(56)%></option>
<option value="1" <%=judge2(ntype,1)%>>├ <%=Lang_News(46)%></option>
<option value="2" <%=judge2(ntype,2)%>>├ <%=Lang_News(47)%></option>
<option value="3" <%=judge2(ntype,3)%>>├ <%=Lang_News(57)%></option>
</select>
</td>
<td style="padding-left:5px;">
<input type="text" name="dateFrom" value="<%=dateFrom%>" size="12" class="form_calendar" onclick="setday(this)" /> - <input type="text" name="dateTo" value="<%=dateTo%>" size="12" class="form_calendar" onclick="setday(this)" />
</td>
<td style="padding-left:5px;">
<input type="text" name="keyword" value="<%= keyword %>" class="form_query" size="15"><input name="Submit" type="submit" value="" title="<%=Lang_sys(25)%>" align="absmiddle" class="btn_query"><input type="hidden" name="pagenum" value="<%= pagenum %>">
</td>
</tr>
</table>
</form>
</td>
<td height="30" align="right" colspan="2" class="classhead">
<%=QuickMenu("home_mes.asp|"& Lang_Menu(16) &"","?action=sortlist|"& Lang_Menu(123) &"")%>
</td>
</tr>
</form>
</tbody>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="classtable" class="classtable2">
<tbody>
<form name="form" action="?action=del" method="post">
<tr>
<td height="30" align="left" colspan="2" class="classhead">
<input type="image" name="Submit" title=" <%=Lang_sys(15)%> " onClick="return confirm('<%=Lang_sys(64)%>')" src="lang/<%=LangFilePath%>/images/bt_delete.gif" align="absmiddle">
<input type="hidden" name="page" value="<%=page%>">
<input type="hidden" name="classid" value="<%=classid%>">
<input type="hidden" name="ntype" value="<%=ntype%>">
<input type="hidden" name="keyword" value="<%=keyword%>">
<input type="hidden" name="dateFrom" value="<%=dateFrom%>">
<input type="hidden" name="dateTo" value="<%=dateTo%>">
<input type="hidden" name="Lang" value="<%=Lang%>">
<input type="hidden" name="pagenum" value="<%= pagenum %>">
</td>
<td height="30" class="classhead" align="right" colspan="3"><%=ors.ShowPageHead(page)%></td>
</tr>
<tr>
<td width="5%" height="30" class="classtop" title="<%=Lang_sys(4)%>" style="cursor:pointer;" onclick="location.href='javascript:selectall();';return false;"><%=Lang_sys(50)%></td>
<td width="15%" class="classtop"><%=Lang_News(58)%></td>
<td width="60%" class="classtop"><%=Lang_News(59)%></td>
<td width="10%" class="classtop"><%=Lang_News(60)%></td>
<td width="10%" class="classtop"><%=Lang_News(61)%></td>
</tr>
<%
If DataCount >0 Then
		For i = 0 To Ubound(DataList,2)
%>
<tr class="classrow">
<td height="30" class="classrow"><input name="id" type="checkbox" value="<%=DataList(0,i)%>"></td>
<td class="classrow" title="<%=DataList(6,i)%>"><%=FormatDateTime(DataList(6,i),2)%></td>
<td class="classrow"><span style="color:<%=DataList(1,i)%>;"><%=DataList(2,i)%></span>&nbsp;<%
if DataList(3,i)=1 then response.write "<img src='../images/news.gif' border=0 title='"& Lang_News(57) &"'>" end If
if DataList(4,i)=1 then response.write "<font color=red>["& Lang_News(46) &"]</font>" end If
if DataList(5,i)=1 then response.write "<font color=red>["& Lang_News(47) &"]</font>" end If
%></td>
<td class="classrow"><%=DataList(8,i)%></td>
<td class="classrow">
<a href="?action=newsmodi&id=<%=DataList(0,i)%>&url=<%=server.urlencode(backurl())%>"><img src="images/icon_edit.gif" title=" <%=Lang_sys(51)%> " border="0"></a>&nbsp;&nbsp;
<%If DataList(7,i)<>"" Then%>
<a href="?action=skin_modi&c_skin=list/<%=DataList(7,i)%>&id=<%=DataList(0,i)%>"><img src="images/icon_viewstyle.gif" title=" <%=Lang_News(62)%> " border="0"></a>&nbsp;&nbsp;
<%End If%>
<a target="_blank" href="<%
If Config_Lebi_Eshop(16) = 0 Then
	Response.Write("../zhuanti.asp?action=news_list&id="& DataList(0,i) &"")
Else
	Response.Write("../news/list/?id="& DataList(0,i) &"")
End If
%>"><img src="images/icon_view.gif" title=" <%=Lang_sys(59)%> " border="0"></a>
</td>
</tr>
<%
        Next
End If
%>
</form>
<tr>
	<td height="30" class="classfooter" colspan="2"><%=GetPageNum(15,pagenum)%></td>
	<td height="30" class="classfooter" align="right" colspan="3"><%=ors.ShowPageFoot(page)%></td>
</tr>
<tr>
  <td class="classfaq" colspan="5">
  <div class="faq_main">
  <p class="faq_title"><%=Lang_sys(49)%></p>
  <%=Lang_News(63)%>
  </div>
  </td>
</tr>
</tbody>
</table>
<script>tdshow("classtable");</script>
<%
end sub

sub classadd()
        admin_flag=",5.4,"
        if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
                adminflag()
        End If
		Set rs = conn.execute("select top 1 ClassId from [Lebi_newsclass] order by ClassId desc")
		If Not rs.eof Then
		bigid = rs(0) + 1
		Else
		bigid = 1
		End If
		rs.close : Set rs = Nothing
%>
<script language="vbscript">
function toAsc(str)
		toAsc = hex(asc(str))
end function
</script>
<script language="javascript">
function LebiCopyFolder()
{
	var iscopy = document.getElementById('CopyFolder');
	if (iscopy.checked){
	document.getElementById('n_foldername').value=document.getElementById('ClassName').value;
	}
}
function LebiCopyFolderToPinYin()
{
	var iscopy = document.getElementById('CopyFolderToPinYin');
	if (iscopy.checked){
	document.getElementById('n_foldername').value=CC2PY(document.getElementById('ClassName').value);
	}
}
function LebiCopyName()
{
	var iscopy = document.getElementById('CopyName');
	if (iscopy.checked){
	document.getElementById('n_filename').value=document.getElementById('ClassName').value;
	}
}
function LebiCopyNameToPinYin()
{
	var iscopy = document.getElementById('CopyNameToPinYin');
	if (iscopy.checked){
	document.getElementById('n_filename').value=CC2PY(document.getElementById('ClassName').value);
	}
}
function CheckClass(theform)
{
	if (CheckEmpty('ClassName<%= LanguageTxt(1) %>')){ShowMessage('ClassName<%= LanguageTxt(1) %>','<%=Lang_News(64)%>');return false;}
}
function ConfirmDelBig()
{
    if(confirm("<%=Lang_News(65)%>"))
        return true;
    else
        return false;
}
</script>
<script language="javascript" type="text/javascript" src="inc/js/PinYin.js"></script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable">
<tr>
<form name="form2" method="post" action="?action=addclass" onSubmit="return CheckClass(this);">
	<td height="30" class="classhead" align="left">
	<input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> " align="absmiddle">
	<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle"></td>
	<td align="right" class="classhead">
	<%=QuickMenu("","")%>
	</td>
</tr>
<tr>
<td height="30" colspan="2" class="classtop"><%=Lang_News(66)%></td>
</tr>
<tr>
<td class="classbg" colspan="2">
<ul id="tablist">
   <%For LangT = 1 To TotalLang%>
   <li<%If LangT = 1 Then response.write(" class=""selected""") End If%>><a rel="tcontent<%= LangT %>" style="CURSOR:hand;"><%= LanguageName(LangT) %></a></li>
   <%Next%>
</ul>
<div id="tabcontentcontainer">
<%For LangT = 1 To TotalLang%>
   <div id="tcontent<%= LangT %>" class="tabcontent">
   <table cellspacing="0" cellpadding="4" width="100%" border="0" id="classtable_<%= LangT %>">
		<tr class="classrow">
		<td height="30" width="15%" class="classrow"><%=Lang_News(67)%></td>
		<td align="left" class="classrow">
		<input id="ClassName<%= LanguageTxt(LangT) %>" name="ClassName<%= LanguageTxt(LangT) %>" type="text" size="20" maxlength="30" class="form"> <span id="mes_ClassName<%= LanguageTxt(LangT) %>"></span></td>
		</tr>
	</table>
	</div>
	<script>tdshow("classtable_<%= LangT %>");</script>
<%Next%>
</div>
<script>showtabcontent("tablist")</script>
<ul id="tablistmain">
   <li class="selected"><a rel=""><%=Lang_sys(66)%></a></li>
</ul>
<div id="tabcontentcontainer">
<table cellspacing="0" cellpadding="4" width="100%" border="0" id="classtable">
<tr class="classrow">
<td height="30" width="15%" class="classrow"><%=Lang_News(68)%></td>
<td class="classrow">
<input name="B_order" type="text" size="5" value="0" maxlength="5" class="form"></td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_News(69)%></td>
<td class="classrow">
<select name="ParentID" style="font-size:11px;"><option value="0"><%=Lang_News(70)%></option><%OptionClass 0,0,""%></select></td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_News(33)%></td>
<td class="classrow">
<table cellspacing="0" cellpadding="0"><tr><td>
<input type="radio" name="user_skin" value="1" onclick="document.getElementById('$_skin').style.display='block';" /> <%=Lang_News(51)%>
<input type="radio" name="user_skin" value="0" onclick="document.getElementById('$_skin').style.display='none';" checked /> <%=Lang_News(52)%></td>
 <td id="$_skin" style="padding-left:5px;display:none"><%=Lang_News(34)%><input type="text" name="news_skin" class="form" value="Lebi.News<%=bigid%>.style" size="41"></td></tr></table>
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_News(71)%></td>
<td class="classrow" colspan="2">
<input name="n_foldername" id="n_foldername" value="" type="text" maxlength="250" class="form" size="20"> <input type="checkbox" onclick="LebiCopyFolder();" name="CopyFolder" value="1" > <%=Lang_News(72)%> <input type="checkbox" onclick="LebiCopyFolderToPinYin();" name="CopyFolderToPinYin" value="1" > <%=Lang_News(42)%>
</td>
</tr>
<tr>
<td class="classtop" height="30" colspan="3"><%=Lang_News(39)%>
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_News(40)%></td>
<td class="classrow" colspan="2">
<input name="n_filename" id="n_filename" value="" type="text" maxlength="250" class="form" size="20"> <img src="images/help.gif" align="absmiddle" onmouseover="showhintinfo(this,0,0,'','<%=Lang_News(43)%>','50','up');" onmouseout="hidehintinfo();" /> <input type="checkbox" onclick="LebiCopyName();" name="CopyName" value="1" > <%=Lang_News(72)%> <input type="checkbox" onclick="LebiCopyNameToPinYin();" name="CopyNameToPinYin" value="1" > <%=Lang_News(42)%>
</td>
</tr>
</table>
</div>
<script>tdshow("classtable");</script>
</td>
</tr>
<tr>
<tr>
<td height="30" colspan="2" align="left" class="classfooter">
<input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> " align="absmiddle">
<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle">
</td>
</tr>
</form>
</table>
<%
end Sub

sub sortlist
        admin_flag=",5.4,"
        if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
                adminflag()
        End If
		dim sql, rsBigClass, rsSmallClass, ErrMsg
%>
<script language="JavaScript" type="text/JavaScript">
function CheckClass(theform)
{
    if (!isEmpty(theform.ClassName,'<%=Lang_News(64)%>')) return false;
}

function ConfirmDelBig()
{
    if(confirm("<%=Lang_News(65)%>"))
        return true;
    else
        return false;
}
</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="classtable" class="classtable">
<tr>
<td align="left" class="classhead" colspan="3">
<input type="image" border="0" title=" <%=Lang_sys(5)%> " onclick="location.href='?action=classadd';return false;" src="lang/<%=LangFilePath%>/images/bt_add.gif" align="absmiddle"></td>
<td height="30" align="right" colspan="2" class="classhead">
<%=QuickMenu("admin_news.asp|"& Lang_Menu(127) &"","admin_news.asp?action=sources|"& Lang_Menu(128) &"")%>
</td>
</tr>
</form>
<tr>
<td width="5%" height="30" class="classtop"><%=Lang_News(73)%></td>
<td width="65%" class="classtop"><%=Lang_News(74)%></td>
<td width="10%" class="classtop"><%=Lang_News(75)%></td>
<td width="10%" class="classtop"><%=Lang_News(76)%></td>
<td width="10%" class="classtop"><%=Lang_News(61)%></td>
</tr>
<%ShowClass 0,""%>
</table>
<script>tdshow("classtable");</script>
<%
end Sub

sub bigmodi
        admin_flag=",5.4,"
        if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
                adminflag()
        End If
		set rs=server.CreateObject("adodb.recordset")
		rs.open "Select * From [Lebi_newsclass] where classid="&CheckNum(request("classid"),0)&"", conn, 1, 1
		ClassID=rs("classid")
		b_order = rs("b_order")
		ParentID = rs("ParentID")
		ClassSkin=Trim(rs("classSkin"))
		n_foldername = rs("n_foldername")
		n_filename = rs("n_filename")
%>
<script language="vbscript">
function toAsc(str)
		toAsc = hex(asc(str))
end function
</script>
<script language="javascript">
function LebiCopyFolder()
{
	var iscopy = document.getElementById('CopyFolder');
	if (iscopy.checked){
	document.getElementById('n_foldername').value=document.getElementById('ClassName').value;
	}
}
function LebiCopyFolderToPinYin()
{
	var iscopy = document.getElementById('CopyFolderToPinYin');
	if (iscopy.checked){
	document.getElementById('n_foldername').value=CC2PY(document.getElementById('ClassName').value);
	}
}
function LebiCopyName()
{
	var iscopy = document.getElementById('CopyName');
	if (iscopy.checked){
	document.getElementById('n_filename').value=document.getElementById('ClassName').value;
	}
}
function LebiCopyNameToPinYin()
{
	var iscopy = document.getElementById('CopyNameToPinYin');
	if (iscopy.checked){
	document.getElementById('n_filename').value=CC2PY(document.getElementById('ClassName').value);
	}
}
function CheckClass(theform)
{
	if (CheckEmpty('ClassName<%= LanguageTxt(1) %>')){ShowMessage('ClassName<%= LanguageTxt(1) %>','<%=Lang_News(64)%>');return false;}
}
function ConfirmDelBig()
{
    if(confirm("<%=Lang_News(65)%>"))
        return true;
    else
        return false;
}
</script>
<script language="javascript" type="text/javascript" src="inc/js/PinYin.js"></script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable">
<form name="form1" method="post" action="?action=modibig" onSubmit="return CheckClass(this);">
<input type="hidden" name="classid" value="<%=request("classid")%>" />
<tr>
	<td class="classhead" height="30" align="left">
	<input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle">
	</td>
	<td align="right" class="classhead">
	<%=QuickMenu("","")%>
	</td>
</tr>
<tr>
  <td class="classtop" colspan="2" height="30"><%=Lang_News(77)%></td>
</tr>
<tr>
<td class="classbg" colspan="2">
<ul id="tablist">
   <%For LangT = 1 To TotalLang%>
   <li<%If LangT = 1 Then response.write(" class=""selected""") End If%>><a rel="tcontent<%= LangT %>" style="CURSOR:hand;"><%= LanguageName(LangT) %></a></li>
   <%Next%>
</ul>
<div id="tabcontentcontainer">
<%For LangT = 1 To TotalLang%>
   <div id="tcontent<%= LangT %>" class="tabcontent">
   <table cellspacing="0" cellpadding="4" width="100%" border="0" id="classtable_<%= LangT %>">
	<tr class="classrow">
	<td height="30" width="15%" class="classrow"><%=Lang_News(67)%></td>
	<td width="85%" class="classrow"> <input id="ClassName<%= LanguageTxt(LangT) %>" name="ClassName<%= LanguageTxt(LangT) %>" type="text" value="<%=rs("classname" & LanguageTxt(LangT))%>" size="20" maxlength="30" class="form"> <span id="mes_ClassName<%= LanguageTxt(LangT) %>"></span></td>
	</tr>
	</table>
	</div>
	<script>tdshow("classtable_<%= LangT %>");</script>
<%Next%>
</div>
<script>showtabcontent("tablist")</script>
<ul id="tablistmain">
   <li class="selected"><a rel=""><%=Lang_sys(66)%></a></li>
</ul>
<div id="tabcontentcontainer">
<table cellspacing="0" cellpadding="4" width="100%" border="0" id="classtable">
<tr class="classrow">
<td height="30" width="15%" class="classrow"><%=Lang_News(68)%></td>
<td class="classrow"> <input name="b_order" type="text" size="5" value="<%=b_order%>" class="form"></td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_News(69)%></td>
<td class="classrow">
<select name="ParentID"">
<option value="0"><%=Lang_News(70)%></option>
<%
OptionClass 0,ParentID,","&ParentID&","%>
</select>
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_News(33)%></td>
<td class="classrow">
<table cellspacing="0" cellpadding="0"><tr><td>
<input type="radio" name="user_skin" value="1" onclick="document.getElementById('$_skin').style.display='block';" <% If ClassSkin<>"" Then Response.Write("checked") %> /> <%=Lang_News(51)%>
<input type="radio" name="user_skin" value="0" onclick="document.getElementById('$_skin').style.display='none';" <% If ClassSkin="" Or IsNull(ClassSkin) Then Response.Write("checked") %> /> <%=Lang_News(52)%></td>
 <td id="$_skin" style="padding-left:5px;<% If ClassSkin="" Then Response.Write("display:none") %>"><%=Lang_News(34)%><input type="text" name="news_skin" class="form" value="<% If ClassSkin="" Then : Response.Write("Lebi.News"&ClassID&".style") : Else : Response.Write(ClassSkin) : End If%>" size="41"></td></tr></table>
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_News(71)%></td>
<td class="classrow" colspan="2">
<input name="n_foldername" id="n_foldername" value="<%=n_foldername%>" type="text" maxlength="250" class="form" size="20"> <input type="checkbox" onclick="LebiCopyFolder();" name="CopyFolder" value="1" > <%=Lang_News(72)%> <input type="checkbox" onclick="LebiCopyFolderToPinYin();" name="CopyFolderToPinYin" value="1" > <%=Lang_News(42)%>
</td>
</tr>
<tr>
<td class="classtop" height="30" colspan="3"><%=Lang_News(39)%>
</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow"><%=Lang_News(40)%></td>
<td class="classrow" colspan="2">
<input name="n_filename" id="n_filename" value="<%=n_filename%>" type="text" maxlength="250" class="form" size="20"> <img src="images/help.gif" align="absmiddle" onmouseover="showhintinfo(this,0,0,'','<%=Lang_News(43)%>','50','up');" onmouseout="hidehintinfo();" /> <input type="checkbox" onclick="LebiCopyName();" name="CopyName" value="1" > <%=Lang_News(72)%> <input type="checkbox" onclick="LebiCopyNameToPinYin();" name="CopyNameToPinYin" value="1" > <%=Lang_News(42)%>
</td>
</tr>
</table>
</div>
<script>tdshow("classtable");</script>
</td>
</tr>
<tr class="classfooter">
<td align="left" colspan="2" height="30" class="classfooter">
   <input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle">
</td>
</tr>
</form>
</table>
<%
		rs.close
		set rs=nothing
end Sub

Sub ShowClass(ParentID,nbsp)
set rsClass=conn.execute("Select * From [Lebi_newsclass] where ParentID = " & ParentID & " order by b_order desc")
do while not rsClass.eof
%>
<tr class="classrow">
<td height="30" class="classrow"><%=rsClass("classid")%></td>
<td class="classrow"><%=nbsp%><%=ChildClass(rsClass("classid"))%><%=rsClass("classname")%></td>
<td class="classrow"><%=rsClass("b_order")%></td>
<td class="classrow"><input type="image" name="up" title="↑" onClick="location.href='?action=up_b&classid=<%=rsClass("classid")%>';return false;" src="images/icon_up.gif" align="absmiddle">&nbsp;<input type="image" name="down" title="↓" onClick="location.href='?action=down_b&classid=<%=rsClass("classid")%>';return false;" src="images/icon_down.gif" align="absmiddle"></td>
<td class="classrow">
 <a href="?action=bigmodi&classname=<%=server.urlencode(rsClass("classname"))%>&classid=<%=rsClass("classid")%>"><img src="images/icon_edit.gif" title=" <%=Lang_sys(51)%> " border="0"></a>&nbsp;&nbsp;
 <a onClick="return ConfirmDelBig();" href="?action=delbig&classname=<%=server.urlencode(rsClass("classname"))%>&classid=<%=rsClass("classid")%>"><img src="images/icon_del.gif" title=" <%=Lang_sys(15)%> " border="0"></a>&nbsp;&nbsp;
<%If rsClass("ClassSkin")<>"" Then%>
<a href="?action=skin_modi&c_skin=<%=rsClass("ClassSkin")%>&sort_id=<%=rsClass("classid")%>"><img src="images/icon_viewstyle.gif" title=" <%=Lang_News(62)%> " border="0"></a>&nbsp;&nbsp;
<%End If%>
<a target="_blank" href="<%
If Config_Lebi_Eshop(16) = 0 Then
	Response.Write("../zhuanti.asp?action=news_class&classid="& rsClass("classid") &"")
Else
	Response.Write("../news/"& rsClass("n_foldername") &"/")
End If
%>"><img src="images/icon_view.gif" title=" <%=Lang_sys(59)%> " border="0"></a>
</td>
</tr>
<%
ShowClass rsClass("classid"),"├---"&nbsp
rsClass.movenext
loop
rsClass.close
set rsClass=nothing
End Sub

Function ChildClass(ParentID)
		set rsClass=conn.execute("Select * From [Lebi_newsclass] where classID = "&ParentID&" and parentId = 0 order by b_order desc")
		if rsClass.eof or rsClass.bof then:ChildClass=" ":else:ChildClass="+ ":end if
		rsClass.close:set rsClass=nothing
End Function

Function DeleteClass(ClassID)
		set rsClass=conn.execute("Select * From [Lebi_newsclass] where ParentID = "&ClassID)
		if not(rsClass.eof or rsClass.bof) then
				do while not rsClass.eof
						DeleteClass(rsClass("classid"))
						rsClass.movenext
				loop
		end if
		rsClass.close:set rsClass=nothing
		conn.Execute("delete from [Lebi_newsclass] where classid="&ClassID)
		'conn.Execute("delete from [Lebi_news] where classid="&ClassID)
End Function

Function ArrayClass(ClassID)
		ArrayClass=ClassID
		set rsClass=conn.execute("Select * From [Lebi_newsclass] where ParentID = "&ClassID)
		if not(rsClass.eof or rsClass.bof) then
				do while not rsClass.eof
						ArrayClass=ArrayClass&","&ArrayClass(rsClass("classid"))
						rsClass.movenext
				loop
		end if
		rsClass.close:set rsClass=nothing
End Function

Function showsortname(sort_id,sort_id_name,sort_name,table_name)
        If IsSqlDataBase = 1 Then
		        sql = "select "&sort_name&" from "&table_name&" where charindex("&sort_id_name&",'"&sort_id&"')>0"
		Else
		        sql = "select "&sort_name&" from "&table_name&" where instr('"&sort_id&"',"&sort_id_name&")>0"
		End If
        set Rs_showname = conn.execute(sql)
        If Rs_showname.eof Then
	    		showsortname = "------"
        Else
				showsortname = Rs_showname(0)
        End If
		Rs_showname.close:set Rs_showname = nothing
End Function

sub skin_modi()
        admin_flag=",5.2,"
        if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
                adminflag()
        End If
		If request("c_skin") = "" Then
				Call Up_mes(Lang_sys(46),"·"& Lang_News(78),m_s_z,"?action=sortlist",0,0,2,0)
				Exit Sub
		End If
%>
<style type="text/css">
table.collapse tfoot td img{border:none;vertical-align:bottom;padding-left:10px;float:right;}
</style>
<script language="javascript">
function tablecollapse()
{
var collapseClass='collapse';
var collapsePic='lang/<%=LangFilePath%>/images/tab/bt_close.gif';
var expandPic='lang/<%=LangFilePath%>/images/tab/bt_open.gif';
var initialCollapse=true;
var t=document.getElementsByTagName('table');
var checktest= new RegExp("(^|\\s)" + collapseClass + "(\\s|$)");
for (var i=0;i<t.length;i++)
{
if(!checktest.test(t[i].className)){continue;}
t[i].getElementsByTagName('tfoot')[0].onclick=function()
{
var tb=this.parentNode.getElementsByTagName('tbody');
for(var i=0;i<tb.length;i++)
{
tb[i].style.display=tb[i].style.display=='none'?'':'none';
}
var li=this.getElementsByTagName('img')[0];
li.src=li.src.indexOf(collapsePic)==-1?collapsePic:expandPic;
}
if(initialCollapse)
{
var tb=t[i].getElementsByTagName('tbody');
for(var j=0;j<tb.length;j++)
{
tb[j].style.display='none';
}
}
var newa=document.createElement('a');
newa.href='#';
newa.onclick=function(){return false;}
var newimg=document.createElement('img');
newimg.src=initialCollapse?expandPic:collapsePic;
var tf=t[i].getElementsByTagName('tfoot')[0];
var lt=tf.getElementsByTagName('td')[tf.getElementsByTagName('td').length-1];
newa.appendChild(newimg);
lt.insertBefore(newa,lt.firstChild);
}
}
window.onload=tablecollapse;
function runscript(n){
	txtRun=n;window.open("../templates_view.asp","templates_view")
}
</script>
<script language="javascript" type="text/javascript" src="ckeditor/ckeditor.js"></script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="classtable">
  <form method="post" action="?action=skin_ok&sort_id=<%=request("sort_id")%>&id=<%=request("id")%>">
	<tr>
	 <td height="30" align="left" class="classhead">
		<input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="this.form.reset();return false;" align="absmiddle"><input type="hidden" name="c_skin" value="<%=request("c_skin")%>"><input type="hidden" name="htmlstate" value="<%=htmlstate%>">
	 </td>
	<td align="right" class="classhead">
		<%=QuickMenu("","")%>
	</td>
	</tr>
	<tr>
	  <td class="classtop" colspan="2" height="30"><%=Lang_News(79)%>
	</td>
   </tr>
<tr class="classrow">
 <td class="classrow" align="left"><%= skin_news & request("c_skin") %></td>
 <td class="classrow" align="right">
 </td>
</tr>
<tr>
<td class="classbg" colspan="2">
<ul id="tablist">
   <%For LangT = 1 To TotalLang%>
   <li<%If LangT = 1 Then response.write(" class=""selected""") End If%>><a rel="tcontent<%= LangT %>" style="CURSOR:hand;"><%= LanguageName(LangT) %></a></li>
   <%Next%>
</ul>
<div id="tabcontentcontainer">
<%
For LangT = 1 To TotalLang
LB_XML.Path = server.MapPath("../skins/"& LanguageSkin(LangT) &"/data.xml")
LB_XML.Data = "data"
LB_XML.open
LB_XML.SelectTable("config")
stylefolder = LB_XML.read("stylefolder")
LB_XML.close
main_skin = LoadSkin("../"& stylefolder &"news/"& request("c_skin"))
%>
   <div id="tcontent<%= LangT %>" class="tabcontent">
	   <table width="100%" align="center" border="0" cellspacing="0" cellpadding="0" style="margin-top:5px">
 <tr class="classrow">
 <td class="classrow" colspan="2">
	<textarea cols=102 rows=24 name="main_skin<%=LangT%>" id="main_skin<%=LangT%>" class=html><%=server.htmlencode(main_skin)%></textarea>
	<%If htmlstate = 0 Then%>
	<script type="text/javascript">
	CKEDITOR.replace('main_skin<%=LangT%>',{height:400});
	</script>
	<%Else%>
	 <br /><a href="javascript:u_Size(-10,'main_skin<%=LangT%>')"><img src="lang/<%=LangFilePath%>/images/tab/bt_close.gif" border='0'></a>
	 <a href="javascript:u_Size(10,'main_skin<%=LangT%>')"><img src="lang/<%=LangFilePath%>/images/tab/bt_open.gif" border='0'></a>
	<%End If%>
 </td>
</tr>
		</table>
	</div>
<%Next%>
</div>
<script>showtabcontent("tablist")</script>
</td>
</tr>
  <tr>
     <td colspan="2" align="left" height="30" class="classfooter">
		<input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> ">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="this.form.reset();return false;">
	 </td>
  </tr>
</form>
</table>
<%End Sub

Sub sources()
        admin_flag=",5.5,"
        if Eshop_Lebi_name="" or instr(","&Eshop_Lebi_flag&",",admin_flag)=0 then
                adminflag()
        End If
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="classtable_add" class="classtable">
<form name="form2" method="post" action="?action=sources_add_ok">
<tr>
  <td colspan="3" height="30" align="left" class="classhead"><input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" title=" <%=Lang_sys(1)%> " align="absmiddle">&nbsp;<input type="image" src="lang/<%=LangFilePath%>/images/bt_res.gif" title=" <%=Lang_sys(2)%> " onclick="reset();return false;" align="absmiddle"></td>
	<td align="right" class="classhead">
	<%=QuickMenu("?action=sortlist|"& Lang_Menu(123) &"","?action=add|"& Lang_Menu(126) &"")%>
	</td>
 </tr>
<tr>
<td class="classtop" width="5%" height="30">&nbsp;</td>
<td class="classtop" width="25%"><%=Lang_News(80)%></td>
<td class="classtop" width="10%"><%=Lang_News(75)%></td>
<td class="classtop">&nbsp;</td>
</tr>
<tr class="classrow">
<td height="30" class="classrow">&nbsp;</td>
<td height="30" class="classrow"><input name="n_name" type="text" id="n_name" size="25" class="form"></td>
<td colspan="2" class="classrow"><input name="n_order" type="text" id="n_order" value=<%=i+1%> size="3" class="form"></td>
</tr>
</form>
</table>
<script>tdshow("classtable_add");</script>
<table width="100%" border="0" cellspacing="0" cellpadding="0" id="classtable" class="classtable" style="margin-top:5px;">
<form name="form1" method="post" action="?action=sources_update">
<tr>
  <td colspan="4" height="30" align="left" class="classhead">
	 <!--<input type="image" border="0" title=" <%=Lang_sys(5)%> " onclick="location.href='?action=sources_add';return false;" src="lang/<%=LangFilePath%>/images/bt_add.gif" align="absmiddle">-->
     <input name="submit" type="image" src="lang/<%=LangFilePath%>/images/bt_app.gif" value=" <%=Lang_sys(1)%> " title=" <%=Lang_sys(1)%> " align="absmiddle">
     <input type="image" border="0" title=" <%=Lang_sys(15)%> " onclick="location.href='javascript:todelsources();';return false;" src="lang/<%=LangFilePath%>/images/bt_delete.gif" align="absmiddle"></td>
 </tr>
<tr>
<td class="classtop" width="5%" height="30" title="<%=Lang_sys(4)%>" style="cursor:pointer;" onclick="location.href='javascript:selectall();';return false;"><%=Lang_sys(50)%></td>
<td class="classtop" width="25%"><%=Lang_News(80)%></td>
<td class="classtop" width="10%"><%=Lang_News(75)%></td>
<td class="classtop">&nbsp;</td>
</tr>
<%set rs=server.CreateObject("adodb.recordset")
rs.open "select * from [Lebi_newssources] order by n_order desc", conn, 1, 1
if rs.eof and rs.bof then
response.write "<tr class=classrow><td class=classrow align=center height=530 colspan=3>空记录集</td></tr>"
else
        do while not rs.eof%>
<tr class="classrow">
<td height="30" class="classrow"><input name="id" type="checkbox" value="<%=rs("n_id")%>"><input name="n_id" type="hidden" value="<%=rs("n_id")%>"><input name="page" type="hidden" value=0><input name="l_type" type="hidden" value="0"></td>
<td height="30" class="classrow">
<input name="n_name" type="text" id="n_name" value="<%=trim(rs("n_name"))%>" size="25" class="form">
</td>
<td colspan="2" class="classrow">
<input name="n_order" type="text" id="n_order" value=<%=rs("n_order")%> size="3" class="form">
</td>
</tr>
<%rs.movenext
loop
end if
rs.close
set rs=nothing%>
</form>
</table>
<script>tdshow("classtable");</script>
<%End Sub

Sub skin_ok()
	Dim main_skin
	If Trim(request("c_skin"))="" Then
		response.write Lang_News(78)
		response.End 
	Else
		For LangT = 1 To TotalLang 
				LB_XML.Path = server.MapPath("../skins/"& LanguageSkin(LangT) &"/data.xml")
				LB_XML.Data = "data"
				LB_XML.open
				LB_XML.SelectTable("config")
				stylefolder = LB_XML.read("stylefolder")
				LB_XML.close
				Savehtml "../"& stylefolder &"news/"& safereplace(request("c_skin")),StyleSafereplace(trim(request("main_skin"& LangT)))
		Next 
		Application.Contents.RemoveAll
		If InStr(request("c_skin"),"list/")>0 Then
				m_u = "admin_skin_save.asp?action=tpl_news_diy&id="& CInt(request("id")) &"&mes_type=0"
		Else
				m_u = "admin_skin_save.asp?action=tpl_news_class_one&id="& CInt(request("sort_id")) &"&mes_type=0"
		End If
	End If
	b_u = "admin_news.asp" 
	m_s = "·"& Lang_sys(99)
	Call Up_mes(Lang_sys(45),m_s,0,m_u&"&b_u="& server.urlencode(b_u),0,0,2,1)
End sub

Function LoadSkin(strFile)
		Dim strTempPath,objFSO,objStm
		strTempPath = Server.MapPath(strFile)
		Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
		Set objStm = Server.CreateObject("ADODB.Stream")
			If objFso.FileExists(strTempPath) Then
				objStm.charset = "UTF-8"
				objStm.open
				objStm.LoadFromFile strTempPath
				LoadSkin = objStm.ReadText
			End If
		Set objStm = Nothing
		Set objFSO = Nothing
End Function

Function CreateSkinList(strFile)
		Dim objFSO,rs_skin
		Dim skin_head,skin_topmenu,skin_topgg,skin_footer,skin_topmain
		Dim tpl_head,tpl_foot,tpl_skin
		Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
		For LangT = 1 To TotalLang
				LB_XML.Path = server.MapPath("../skins/"& LanguageSkin(LangT) &"/data.xml")
				LB_XML.Data = "data"
				LB_XML.open
				LB_XML.SelectTable("config")
				stylefolder = LB_XML.read("stylefolder")
				LB_XML.close
				If Not objFso.FileExists(Server.MapPath("../"& stylefolder &"news/list/"& strFile)) Then
						If Not objFSO.FolderExists(server.MapPath("../"& stylefolder &"news/")) Then 
								objFSO.CreateFolder(server.MapPath("../"& stylefolder &"news/")) 
						End If 
						If Not objFSO.FolderExists(server.MapPath("../"& stylefolder &"news/list/")) Then 
								objFSO.CreateFolder(server.MapPath("../"& stylefolder &"news/list/")) 
						End If 
						Savehtml "../"& stylefolder &"news/list/"& strFile,LoadFile("../skins/"& LanguageSkin(LangT) &"/template/news_detail.htm")
				End If 
		Next
		Set objFSO = Nothing
End Function

Function CreateSkin(strFile)
		Dim objFSO,rs_skin
		Dim skin_head,skin_topmenu,skin_topgg,skin_footer,skin_topmain
		Dim tpl_head,tpl_foot,tpl_skin
		Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
		For LangT = 1 To TotalLang
				LB_XML.Path = server.MapPath("../skins/"& LanguageSkin(LangT) &"/data.xml")
				LB_XML.Data = "data"
				LB_XML.open
				LB_XML.SelectTable("config")
				stylefolder = LB_XML.read("stylefolder")
				LB_XML.close
				If Not objFso.FileExists(Server.MapPath("../"& stylefolder &"news/"& strFile)) Then
						If Not objFSO.FolderExists(server.MapPath("../"& stylefolder &"news/")) Then 
								objFSO.CreateFolder(server.MapPath("../"& stylefolder &"news/")) 
						End If 
						Savehtml "../"& stylefolder &"news/"& strFile,LoadFile("../skins/"& LanguageSkin(LangT) &"/template/news_list.htm")
				End If 
		Next
		Set objFSO = Nothing
End Function
%>