SoFunction
Updated on 2025-04-13

fso instance

<!--#include file=""-->
<!--#include file="inc/"-->
<%
function changechr(str)
changechr=replace(replace(replace(replace(changechr,"[pic]","<img src="),"[b]","<b>"),"[red]","<font color=CC0000>"),"[big]","<font size=7>")
changechr=replace(replace(replace(replace(changechr,"[/pic]","></img>"),"[/b]","</b>"),"[/red]","</font>"),"[/big]","</font>")
changechr=replace(replace(replace(replace(str,"<","&lt;"),">","&gt;"),chr(13),"<br>")," ","&nbsp;")
end function
%>

<%
if ("newsadminok")="" then
""
end if
if ("txttitle")="" then
"Error prompt: Please enter the news title!"

end if
if ("txtcontent")="" then
"Error prompt: Please do not enter news content!"

end if
dim title
dim content
dim sql
dim rs
dim articleid
dim classid,Nclassid
dim from

title=htmlencode2(("txttitle"))
from=("Nfrom")
zznews=("zznews")
typeid=("typeid")
about=("about")
headline=("headline")
ftitle=htmlencode2(("ftitle"))

dim sql1
dim rs1
dim typename
sql1="select * from type where type")
sql1,conn,1,1
typename=rs1("type")

if ("checkbox1")="1" then
tjnews=1
else
tjnews=2
end if

if ("yheadline")="1" then
yheadline=1
else
yheadline=0
end if

content=htmlencode(("txtcontent"))

set rs = ("")
StrSql = "select E_Memo from Example"
set rs = (StrSql)




fname = makefilename(now())



dddd = year(now()) & "year" & month(now()) & "month" & day(now()) & "day" & hour(now())&":"&minute(now()))
pencat=rs("E_Memo")
pencat=replace(pencat,"lx",typename)
pencat=replace(pencat,"Date",dddd)
if from="" then
pencat=replace(pencat,"From","")
else
pencat=replace(pencat,"From","Excerpt from:" & from)
end if
if zznews="" then
pencat=replace(pencat,"Fname",Editor)
zznews=Editor
else
pencat=replace(pencat,"Fname",zznews)
end if
pencat=replace(pencat,"H_Title",title)
pencat=replace(pencat,"H_Memo",content)
pencat=replace(pencat,"labout",about)
pencat=replace(pencat,"ftitle",ftitle)

newsdate = year(now()) & "." & month(now()) & "." & day(now())
TimePath = year(Now()) & "-" & month(now()) & "-" & day(Now())
FolderPath = (".")& "\" & TimePath




'Save news into the database

sql="select * from article where (newsid is null)"

sql,conn,1,3

rs("title")=title
rs("content")=content
rs("Nfrom")=from
rs("typeid")=typeid
rs("path")=TimePath
rs("typename")=typename
rs("tjnews")=tjnews
rs("N_Fname")=fname
rs("zznews")=zznews
rs("about")=about
rs("newsdate")=newsdate
rs("yheadline")=yheadline
rs("headline")=headline
if ftitle <> "" then rs("ftitle")=ftitle


pencat=replace(pencat,"h_id",rs("newsid"))

Set fso = ("")
If CheckDir(FolderPath) = True Then
Set fout = (FolderPath & "\" & fname)
Else
MakeNewsDir TimePath
Set fout = (FolderPath & "\" & fname)
End if
pencat


articleid=rs("newsid")
UpdateJs(news)

set rs1=nothing

set rs=nothing

set conn=nothing
""
%>