⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 plus.asp

📁 网页源码,是最好的网店代码。可以支持批量上传产品等功能。
💻 ASP
📖 第 1 页 / 共 2 页
字号:
end sub

sub ismode
   yxbbs.execute("update [yx_skinstyle] set ismode=true where skinid="&id )
   yxbbs.execute("update [yx_skinstyle] set ismode=false where skinid<"&id&" or skinid>"&id)
   call suc("","此风格被设置为添加论坛风格的引用模版!","?action=skin")
end sub

sub skindel
	yxbbs.execute("delete from [yx_skinstyle] where skinid="&id)
	call suc("","风格已被成功删除!","?action=skin")
end sub

sub addskin
dim temp,skinname,txt,ismode
set rs=yxbbs.execute("select top 1 skinname,skinid,skincontent from [yx_skinstyle] where ismode")
if not rs.eof then
	ismode=true
	skinname=rs("skinname")
	yxbbs.template.templatecontent=rs("skincontent")
	temp=yxbbs.template.readtemplatename
	txt="当前的元素引用 风格模版 <font color=red>" & SkinName &"</font>"
else
	ismode=false
	temp=split(str,"|")
	txt="当前没有引用 风格模版 "
end if
rs.close
%>
<script>
var isopen=1;
</script>
<form method=post style="margin:0 " action="?action=saveaddskin">
<div class="ta">
<div class="th jz">添加新风格</div>
<div class="tf">风格名称:<input type="text" name="skinname" >&nbsp;&nbsp;&nbsp;<%=txt%></div>
<%
		for i = 0 to ubound(temp)
			 response.write "<div class=""td3 w771""><li>" & temp(i) & "</div><div class=""tf w771""><TEXTAREA NAME='TmpName_"&i&"' ROWS=10>"
			 If IsMode Then
			 Response.Write YxBBs.Fun.HtmlCode(YxBBs.Template.ReadTemplate(Temp(i)))
			 End If
			 response.write"</textarea></div>"
		next
%>
<div style="clear: both;"></div><div class="tf"><input name="submit" type="submit" value=" 添 加 "></div>
</div></form>
<%
end sub

sub saveaddskin
dim temp,content,resulterr,ts
  if request("skinname")="" then
     call goback("","请填写风格名称!")
	 exit sub
  end if
  temp=split(str,"|")
  for i = 0 to ubound(temp)
      content=content&vbcrlf&vbcrlf&"["&temp(i)&"]"&vbcrlf&vbcrlf&savereplace(request("tmpname_"&i))&vbcrlf&vbcrlf&"[/"&temp(i)&"]"
      if request("tmpname_"&i)="" then
        resulterr=resulterr&"<font color=#ff0033>"&temp(i)&"</font>,"
	  end if
  next
  yxbbs.execute("insert into yx_skinstyle(skinname,skincontent) values('"&replace(request("skinname"),"'","''")&"','"&replace(content,"'","''")&"')")
  if resulterr<>"" then
	  call suc("","此风格模版以下的元素"&resulterr&" 没有内容!<li>请到风格管理里面编辑!","?action=skin")
  else
	  call suc("","成功添加<b>"&request("skinname")&"</b>风格","?action=skin")
  end if
end sub

sub editskin
	dim temp,skinname
	set rs=yxbbs.execute("select skinname,skincontent from [yx_skinstyle] where skinid="&id)
	skinname=rs(0)
	yxbbs.template.templatecontent=rs(1)
	rs.close
	temp=yxbbs.template.readtemplatename
	%>
<div class="ta">
<div class="th jz">修改风格</div>
<div class="tf h20"><form method=post style="margin:0" action="?action=updateskinname">风格名称:<input type="text" name="skinname" value="<%=skinname%>"> <input type="hidden" name="id" value="<%=id%>"><input type="submit" value="更改风格名称">
</form></div>
<%
	if isarray(temp) then
		for i = 0 to ubound(temp)
			 response.write "<div class=""td3 h20 w100""><li>" & temp(i) & " </div><div class=""td3 h20 w680""><a href=#edit onclick=""Edit(viewcode" & i & ",'" & Temp(i) & "')"">修改</a></div><div class=""tf w770"" id='viewcode"& i &"' bordercolor=#999999 style='color:#888888;display:none'>" &HtmlenCode(YxBBs.Template.ReadTemplate(Temp(i)))&  "</div>"
		next
	else
		response.write "<div class=""td3 w771"">暂时还没有风格模板元素</div>"
	end if
%>

<br />
<form name=form1 style="margin:0 " method=post action="?action=saveeditskin">
<div class="td1 w770"><INPUT TYPE="hidden" Name="SkinName" value="no"><INPUT TYPE="hidden" name="ID" value="<%=ID%>">
       <font color=red>修改风格元素</font><a name=Edit></a>:&nbsp;<INPUT TYPE="text" NAME="NodeType" ReadOnly>
       <br> &nbsp;&nbsp;元素值 <br><textarea name=Content cols="100" rows="15" style="font-size:12px"></textarea><input type=submit value=" 修改风格 "></div>
<div style="clear: both;"></div>
</form>
</div>
<%
end sub


sub saveeditskin
	dim temp
	id=yxbbs.fun.getstr("id")
	set rs=yxbbs.execute("select skincontent from[yx_skinstyle] where skinid="&id)
	yxbbs.template.templatecontent=rs(0)
	rs.close
	if request.form("skinname")<>"no" and request.form("skinname")<>"" then
		temp=yxbbs.template.edittemplate(request.form("skinname"),request.form("content"))
		yxbbs.execute("update [yx_skinstyle] set skincontent='"&replace(temp,"'","''")&"' where skinid="&id)
		call suc("","风格的元素 ["&request.form("skinname")&"] 风格修改成功。",request.servervariables("http_referer"))
		cache.name="skin_"& id
		cache.clean()
	else
	     call goback("","请先选取相应的风格元素。")
	end if
end sub

function HtmlenCode(fstring)
	if not isnull(fstring) then
		fstring = replace(fstring, ">", "&gt;")
		fstring = replace(fstring, "<", "&lt;")
		fstring = replace(fstring, chr(32), "&nbsp;")
		fstring = replace(fstring, chr(9), "&nbsp;")
		fstring = replace(fstring, chr(34), "&quot;")
		fstring = replace(fstring, chr(39), "&#39;")
		fstring = replace(fstring, chr(13), "")
		fstring = replace(fstring, chr(10) & chr(10), "</p><p> ")
		fstring = replace(fstring, chr(10), "<br /> ")
		htmlencode = fstring
	end if
end function

sub updateskinname
	ID=Request("ID")
	YxBBs.Execute("Update [YX_SkinStyle] Set SkinName='"&Replace(Request("SkinName"),"'","''")&"' Where SkinID="&ID)
	Call Suc("","风格名称修改成功。","?action=skin")
	'Cache.name="Skin_"& ID
	'Cache.clean()
	'Cache.Name="SkinList"
	'Cache.clean()
	Application.Contents.RemoveAll
End Sub

sub datapost
	dim msg,mdbname,sid
	sID=Request("sID")
	if sid="" then call goback("","您还没有选定一个项目!"):exit sub
	mdbname=request("skinmdb")
        if request("to")="inputskin" then
	    skinconnection(mdbname)
	    if request("submit")="删除" then
	       skinconn.execute("delete from [yx_skinstyle] where skinid in ("&sid&")")
		   call suc("","风格模版成功删除!","?action=skin"):exit sub
		else
		  set rs=skinconn.execute(" select skinname,skincontent from [yx_skinstyle] where skinid in ("&sid&")  order by skinid ")
          while not rs.eof
              yxbbs.execute("insert into [yx_skinstyle](skinname,skincontent) values('"&replace(rs(0),"'","''")&"','"&replace(rs(1),"'","''")&"')")  
		rs.movenext
          wend
		  	rs.close
		  call suc("","风格模版数据导入成功!","?action=skin")
		  cache.name="skinlist"
		  cache.clean()
		  exit sub
		end if
    else
	      skinconnection(mdbname)
	      set rs=yxbbs.execute(" select skinname,skincontent from [yx_skinstyle] where skinid in ("&sid&")  order by skinid ")
          while not rs.eof
              skinconn.execute("insert into [yx_skinstyle](skinname,skincontent) values('"&replace(rs(0),"'","''")&"','"&replace(rs(1),"'","''")&"')")  
			  rs.movenext
          wend 
		  rs.close
		  call suc("","风格模版数据导出成功!","?action=skin")
   end if
end sub


sub skindata
dim flagname,mdbname,act
if request("flag")="loadthis" then
    flagname="导入"
    act="inputskin"
    mdbname=trim(request.form("skinmdb"))
    if mdbname="" then
		call goback("","请填写导出风格模版保存的表名")
		exit sub
	end if
else
	flagname="导出"
	act="outskin"
end if
%>
 <%
   if act="inputskin" then
	  skinconnection(mdbname)
	  set rs=skinconn.execute("select skinid,skinname from [yx_skinstyle] order by skinid")
   else
	 set  rs=yxbbs.execute("select skinid,skinname from [yx_skinstyle] order by skinid")
	 mdbname="../skins/yx_skinstyle.mdb"
   end if
   dim temp,i
   if rs.eof then call goback("","该数据库中没有风格模版的数据!"):exit sub%>
<form action="?action=datapost&to=<%=act%>" method=post name=even>
<div class="ta">
<div class="th jz"><%=flagname%>风格模版数据</div>
<div class="td3 jz w87">序号</div>
<div class="td3 jz w600">风格名称</div>
<div class="td3 jz w87">选择</div>
<%
   temp=rs.getrows()
   for i=0 to ubound(temp,2)
   %><div class="td3 jz w87"><%=temp(0,i)%></div><div class="td3 jz w600"><%=temp(1,i)%></div><div class="td3 jz w87"><input type="checkbox" name="sid" value="<%=temp(0,i)%>"></div>
    <%next%>
    <div class="tf w987"> <%=flagname%>的数据库:
          <input type="text" name="skinmdb" size="30" value="<%=mdbname%>"> <input type="submit" name="submit" value="<%=flagname%>">
          <%if act="inputskin" then%>
          <input type="submit" name="submit" value=删除  onclick="checkclick('删除后将不能恢复!您确定要删除吗?');">
          <%end if%>
<input type=checkbox name=chkall value=on onclick="checkall(this.form)"> 全选</div></div></form><%
end sub

sub load()
%>
<form action="?action=skindata&flag=loadthis" method=post>
<div class="ta">
<div class="th jz">导入风格模版数据库名:</div>
<div class="td w770">导入风格模版数据库名:<input name="skinmdb"  size="30" value="../skins/yx_skinstyle.mdb"></div>
<div style="clear: both;"></div><div class="tf jz"> <input type="submit" value="下一步" name="b1"></div>
</div>
</form>
<%end sub

sub skinconnection(mdbname)
on error resume next 
	set skinconn = server.createobject("adodb.connection")
	skinconn.open "provider=microsoft.jet.oledb.4.0;data source=" & server.mappath(mdbname)
	if err then 
		call goback("",mdbname&" 数据库不存在!")
		adminfooter()
		response.end
	end if
end sub
%>
<script language="javascript">
<!--
function checkall(form) {
 for (var i=0;i<form.elements.length;i++)	{
	var e = form.elements[i];
	if (e.name != 'chkall')
		e.checked = form.chkall.checked; 
	}
 }
//-->
</script>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -