A compact and practical ASP CMS----NCMS_ Common tools

Source: Internet
Author: User
Tags chr compact

Http://www.google.com/search?hl=zh-CN&q=ncms&lr=lang_zh-CN

To do an ASP site, basically are news, and some single articles, announcements. So find this ncms on the Internet. The Compress bag is only 300k, it is small. function is not much, mainly news, announcements, advertising management, user management, and then template management, news collection, data compression backup. News is an infinite category, practical! ~ Generate static Files! ~ Can be billed articles, custom file names and templates! Thoughtful!  ~ ~ This CMS is simple and practical, suitable for small build station! I'm just getting started, and I'm not familiar with it. Modified his function.asp file, adding a pclass mark to the place where the news file was generated, to display the category name of the article

function Createnewsfile (ID)
Dim Rs,sql,pclass
Set rs = Server.CreateObject ("Adodb.recordset")
sql = "Select Id,classid,title,content,author,source,keywords,bimg,simg,filename,pagetype,addtime from NCMS_news Where id= "& ID
Rs.Open sql,conn,1,1
Dim Databox:databox = Rs.getrows ()
Rs.close
Rs.Open "SELECT * from Ncms_class where id=" & Databox (1,0), conn,1,1
Pclass=rs ("CNAME")
Rs.close
Set rs = Nothing
Dim Temp:temp = ""
If Databox (10,0) = 0 Then
Temp = Processcustomtag (Loadtempletfile ("...). /templet/"& Getclassall (Databox (1,0), 2) &"))
Else
Temp = Processcustomtag (Loadtempletfile ("...). /templet/"& Site_stemp &"))
End If
Dim Charclass
Set charclass = new Stringclass
Dim Patrnstr,advcont
Patrnstr = "<title>.*?</title>"
Temp = Charclass.replacestr (patrnstr,temp, "<title>" & Charclass.getstr (Databox (2,0)) & "-" & Site_ Name & "</title>")
Patrnstr = "\{\ $pclass \$\}"
Temp = Charclass.replacestr (Patrnstr,temp,pclass)
Patrnstr = "{news:[^<>]+?\/}"
Temp = Charclass.newscustomtag (Patrnstr,temp,databox (1,0), Databox (0,0), Databox (6,0))
Patrnstr = "\{\ $id \$\}"
Temp = Charclass.replacestr (Patrnstr,temp,databox (0,0))
Patrnstr = "\{\ $classid \$\}"
Temp = Charclass.replacestr (Patrnstr,temp,databox (1,0))
Patrnstr = "\{\ $title \$\}"
Temp = Charclass.replacestr (Patrnstr,temp,databox (2,0))
Patrnstr = "\{\ $author \$\}"
Temp = Charclass.replacestr (Patrnstr,temp,databox (4,0))
Patrnstr = "\{\ $source \$\}"
Temp = Charclass.replacestr (Patrnstr,temp,databox (5,0))
Patrnstr = "\{\ $keywords \$\}"
Temp = Charclass.replacestr (Patrnstr,temp,databox (6,0))
Patrnstr = "\{\ $click \$\}"
Temp = Charclass.replacestr (Patrnstr,temp,click (Databox (0,0)))
Patrnstr = "\{\ $addtime \$\}"
Temp = Charclass.replacestr (Patrnstr,temp,databox (11,0))
Patrnstr = "\{\ $guide \$\}"
Temp = Charclass.replacestr (Patrnstr,temp,guide (Databox (1,0)))
Patrnstr = "\{\ $search \$\}"
Temp = Charclass.replacestr (Patrnstr,temp,search ())
Patrnstr = "\{\ $toolbar \$\}"
Temp = Charclass.replacestr (Patrnstr,temp,toolbar (Databox (0,0)))
Patrnstr = "\{\ $description \$\}"
Temp = Charclass.replacestr (patrnstr,temp,site_description)
Patrnstr = "\{\ $copyright \$\}"
Temp = Charclass.replacestr (patrnstr,temp,site_copyright)
Patrnstr = "\{\ $root \$\}"
Temp = Charclass.replacestr (patrnstr,temp,site_root)
Patrnstr = "\{\ $advarea \$\}"
Advcont = Databox (3,0)
Advcont = Charclass.replacestr (Patrnstr,advcont,advshow (Site_advcode))
Dim Temparr,n,spath,epath,cpath:cpath = "& Site_root &"/"& site_html &"/"& Getclasspath Databox ( 1,0)) & "/"
If InStr (Databox (9,0), "/") = 0 Then
Createdir (Server.MapPath (CPath))
Else
Temparr = Split (Databox (9,0), "/")
For n = 0 To UBound (Temparr)
Epath = replace (Databox (9,0), Temparr (n), "")
Next
Createdir (Server.MapPath (CPath & Epath))
End If
Dim Ttemp:ttemp = Temp
Dim Arrcont:arrcont = Split (Advcont, "{$split $}", -1,1)
Dim pagehtm:pagehtm = ""
Dim i,j,k:k = UBound (Arrcont)
For i = 0 to K
If i = 0 Then
spath = "" & CPath & Databox (9,0) & Site_extname & ""
Else
spath = "" & CPath & Databox (9,0) & Site_extname & ""
spath = Left (spath, (Len (spath)-len (site_extname)) & "_" & I + 1 & site_extname
End If
If spath = "" Then
Createnewsfile = False
Exit function
End If
If k >= 1 Then
pagehtm = "<p align=" "Center" > "This news total <font color=" "Red" ">" & K + 1 & "</font> page"-"
If i = 0 Then
pagehtm = pagehtm & "" Home "-"
pagehtm = pagehtm & "" on page "-"
End If
If i > 1 then
pagehtm = pagehtm & "" <a href= "" & CPath & Databox (9,0) & Site_extname & "" "> Home </a>"-"
pagehtm = pagehtm & "" <a href= "" & CPath & Databox (9,0) & "_" & I & Site_extname & "" > Prev </a> "-"
End If
If i = 1 Then
pagehtm = pagehtm & "" <a href= "" & CPath & Databox (9,0) & Site_extname & "" "> Home </a>"-"
pagehtm = pagehtm & "" <a href= "" & CPath & Databox (9,0) & Site_extname & "" "> Page </a>"-"
End If
If I < K then
pagehtm = pagehtm & "" <a href= "" & CPath & Databox (9,0) & "_" & I + 2 & site_extname & "" > next page </a> "-"
pagehtm = pagehtm & "" <a href= "" & CPath & Databox (9,0) & "_" & K + 1 & site_extname & "" > Last </a> "-"
End If
If i = K Then
pagehtm = pagehtm & "" Next Page "-"
pagehtm = pagehtm & "" Last "-"
End If
pagehtm = pagehtm & "" Currently in <font color= "" Red "" > "& i + 1 &" </font> page "</p>"
Else
pagehtm = ""
End If
Patrnstr = "\{\ $content \$\}"
Temp = Charclass.replacestr (Patrnstr,ttemp, "" & Chr (a) & "<div id=" "Content" ">" & Chr (a) & Arrcon T (i) & pagehtm & Chr (a) & "</div>" & Chr (10))
Dim objstream
Set objstream = Server.CreateObject ("ADODB.stream")
With Objstream
. Open
. CharSet = "" & Chrset & ""
. Position = Objstream.size
. WRITETEXT = Temp
. SaveToFile Server.MapPath (spath), 2
. Close
End With
Set objstream = Nothing
Next
If Err.Number <> 0 Then
Err.Clear
Createnewsfile = False
Else
Conn.execute ("Update ncms_news set created=1 where id=" & Databox (0,0))
Createnewsfile = True
Databox = ""
End If
End Function

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.