Recently, many people are very interested in tsys. What you don't know is that tsys's asp version has already stopped development, I used PHP to re-develop a more powerful cms Based on the asp version of tsys. The name is blackhand, this version retains all the advantages of tsys, shields the disadvantages of tsys, and adds many great functions. If you are interested, you can take a look.
In addition, the asp version of tsys requires the webmaster to write asp scripts. Similarly, for flexibility, this PHP version requires the webmaster to write PHP scripts. Only in this way can the webmaster be more flexible, it can be used for other features that cms does not dare to involve or never can do. this is the true meaning of tsys!
PHP tsys browser page: Http://hi.baidu.com/see7di/blog/item/4daf1955bd555bc8b745ae93.html
PHP tsys: Http://download.csdn.net/source/3248406
####### System preset tag library-start ########################## ######################################## ###########
'Method: resource field read tag processing TSYS: data (field name)
'Parameter: Tsys tag
'Back: Resource Field Data
Private Function tshortag_data_field (myFlag)
Tsf-ag_data_field = ""
If Trim (myFlag. Value) <> "" Or Not IsNull (myFlag. Value) Then
Tshortag_data_field = RsInfo (Trim (myFlag. Value ))
End If
End Function
'Method: related resource list TSYS: relate_list (quantity, "related list style template ")
'Parameter: Tsys tag
'Return: Html string in the paging list
'Note:
'Related list style template: You can use the User-Defined personalized list effects.
'The available dynamic variables in the style template include:
'$ Id $ resource id
'$ Title $ resource title
'$ Url $ & nbsp; resource access address
'$ Author
'$ Addtime $ add time
'$ Class_title $ channel name
'$ Class_id $ channel id
'$ Class_url $ channel address
Private Function tshortag_relate_list (myFlag)
Dim Relate_IdList
Relate_IdList = RsInfo ("relate_list ")
If IsNull (Relate_IdList) Or Relate_IdList = "" Then
Tsf-ag_relate_list = ""
Exit Function
End If
Dim regEx, Matches
Set regEx = New RegExp
RegEx. IgnoreCase = False
RegEx. Global = False
RegEx. MultiLine = False
RegEx. pattern = "[\ s] {0,} ([\ d] +) [\ s] {0,}, [\ s] {0 ,} '([^'] {0 ,})'"
Set Matches = regEx. Execute (myFlag. value)
Tsf-ag_relate_list = ""
Dim strTemplate, strTemplate2, TopNum
StrTemplate2 = ""
If Matches. Count = 0 Then
StrTemplate = ""
TopNum = 10
Else
StrTemplate = Trim (Matches (0). SubMatches (1 ))
TopNum = FLib. SafeSql (Matches (0). SubMatches (0 ))
End If
If strTemplate = "" Then
StrTemplate = "· <a href =" "$ url $" "target =" "_ blank" "> $ title $ </a> & nbsp; <font color = "" #808080 "> [$ addtime $] </font> $ br $"
End If
Dim SQL, Rs, strHtml
StrHtml = ""
SQL = "sel & #101; ct TOP" & TopNum & "id, title, author, visit_url, addtime, class_title, class_id, home_url FROM view_resource wh & #101; re id IN ("& Relate_IdList &")"
Set Rs = Db. ExeCute (SQL)
While Not Rs. Eof
StrTemplate2 = Replace (strTemplate, "$ id $", Rs ("id "))
StrTemplate2 = Replace (strTemplate2, "$ title $", Rs ("title "))
StrTemplate2 = Replace (strTemplate2, "$ url $", Rs ("visit_url "))
StrTemplate2 = Replace (strTemplate2, "$ author $", Rs ("author "))
StrTemplate2 = Replace (strTemplate2, "$ addtime $", FLib. FormatMyDate (Rs ("addtime"), "{y}-{m}-{d }"))
StrTemplate2 = Replace (strTemplate2, "$ class_title $", Rs ("class_title "))
StrTemplate2 = Replace (strTemplate2, "$ class_id $", Rs ("class_id "))
StrTemplate2 = Replace (strTemplate2, "$ class_url $", Rs ("home_url "))
StrTemplate2 = Replace (strTemplate2, "$ br $", "<br> ")
StrHtml = strHtml & strTemplate2 & vbCrLf
Rs. MoveNext ()
Wend
Rs. Close ()
Set Rs = Nothing
Set regEx = Nothing
Set Matches = Nothing
Tsf-ag_relate_list = strHtml
Set strHtml = Nothing
End Function
'Method: Paging list TSYS: pages_list (paging type, 'pagination style template', 'pagination style template' on the current page ')
'Parameter: Tsys tag
'Return: Html string in the paging list
'Note:
'Pagination list style template: You can use the custom pagination list.
'The available dynamic variables in the style template include:
'$ Id $ resource id
'$ Title $ resource title
'$ Title2 $ resource Title 2, which is cleared by Html tags
'$ Title3 $ resource Title 3, subject to url encoding and Html Tag clearing
'$ Url $ resource access address
'$ Page $ current page number
'$ Addtime $ add time, {y}-{m}-{d}
'$ Addtime2 $ add time 2, {d}/{m}
Private Function tshortag_pages_list (myFlag)
Dim regEx, Matches
Set regEx = New RegExp
RegEx. IgnoreCase = False
RegEx. Global = False
RegEx. MultiLine = False
RegEx. pattern = "([\ d] +) [\ s] {0,}, [\ s] {0,} '([^'] {0 ,}) '[\ s] {0,}, [\ s] {0,}' ([^ '] {0 ,})'"
Set Matches = regEx. Execute (myFlag. value)
Tsf-ag_pages_list = ""
Dim strTemplate, strTemplate_CurrPage, ListType
If Matches. Count = 0 Then
StrTemplate = ""
StrTemplate_CurrPage = ""
Else
StrTemplate = Trim (Matches (0). SubMatches (1 ))
StrTemplate_CurrPage = Trim (Matches (0). SubMatches (2 ))
ListType = Matches (0). SubMatches (0)
End If
If strTemplate = "" Then
StrTemplate = "<a href =" "$ url $" "title =" "$ title2 $" "> [$ page $] </a> & nbsp ;"
End If
If strTemplate_CurrPage = "" Then
StrTemplate_CurrPage = "<a href =" "$ url $" "title =" "$ title2 $" "> <B> [$ page $] </B> </a> & nbsp;"
End If
If RsInfo ("pages_count") = 0 Then
Set regEx = Nothing
Set Matches = Nothing
Exit Function
End If
Dim SQL, Rs, I, strHtml, tmpTitle, tmpTemplate, VisitUrl
I = 1
If RsInfo ("pages_head") =-1 Then
SQL = "sel & #101; ct TOP" & RsInfo ("pages_count") & "id, title, visit_url, addtime FROM resource_list wh & #101; re id = "& RsInfo (" id ") &" Or pages_head = "& RsInfo (" id ") &" order by pages_position"
Else
SQL = "sel & #101; ct TOP" & RsInfo ("pages_count") & "id, title, visit_url, addtime FROM resource_list wh & #101; re id = "& RsInfo (" pages_head ") &" Or pages_head = "& RsInfo (" pages_head ") &" order by pages_position"
End If
Set Rs = Db. ExeCute (SQL)
While Not Rs. Eof
'If IsNull (Rs ("visit_url") Or Rs ("visit_url") = "" Then
'Visiturl = ""
'Else
VisitUrl = Rs ("visit_url ")
'End If
If Rs ("id") = RsInfo ("id") Then
TmpTemplate = strTemplate_CurrPage
Else
TmpTemplate = strTemplate
End If
TmpTemplate = Replace (tmpTemplate, "$ id $", Rs ("id "))
TmpTitle = Rs ("title ")
TmpTemplate = Replace (tmpTemplate, "$ title $", tmpTitle)
TmpTitle = RegReplace ("<. *?> ", TmpTitle ,"")
TmpTemplate = Replace (tmpTemplate, "$ title2 $", tmpTitle)
TmpTemplate = Replace (tmpTemplate, "$ title3 $", Server. UrlEncode (tmpTitle ))
TmpTemplate = Replace (tmpTemplate, "$ url $", VisitUrl)
TmpTemplate = Replace (tmpTemplate, "$ page $", I)
TmpTemplate = Replace (tmpTemplate, "$ addtime $", FLib. FormatMyDate (Rs ("addtime"), "{y}-{m}-{d }"))
TmpTemplate = Replace (tmpTemplate, "$ br $", "<br> ")
StrHtml = strHtml & tmpTemplate
I = I + 1
Rs. MoveNext ()
Wend
Rs. Close ()
Set Rs = Nothing
If strHtml <> "" Then
If ListType = "1" Then
Tsung ag_pages_list = "<sel & #101; ct onchange =" "location = this. options [this. options. sel & #101; ctedIndex]. value ""> "& strHtml &" </option>"
Else
Tsf-ag_pages_list = strHtml
End If
Else
Tsf-ag_pages_list = strHtml
End If
Set regEx = Nothing
Set Matches = Nothing
Set strHtml = Nothing
End Function
'Method: Character url encoding TSYS: urlencode (string)
'Parameter: Tsys tag
'Return: url encoded data
Private Function tshortag_urlencode (myFlag)
Tsf-ag_urlencode = ""
If myFlag. Value = "" Or IsNull (myFlag. Value) Then
Exit Function
End If
Tshortag_urlencode = Server. UrlEncode (myFlag. Value)
End Function
'Method: String truncation function TSYS: left (string, truncation length, 'replenishment string ')
'Parameter: Tsys tag
'Return: Truncated string
Private Function t0000ag_left (myFlag)
Dim regEx, Matches
Set regEx = New RegExp
RegEx. IgnoreCase = False
RegEx. Global = False
RegEx. MultiLine = False
RegEx. pattern = "([^ \,] {0,}), [\ s] {0,} ([\ d] +) [\ s] {0 ,}, [\ s] {0,} '([^'] {0 ,})'"
Set Matches = regEx. Execute (myFlag. Value)
Tsung ag_left = ""
If Matches. Count> 0 Then
'If Len (Matches (0). SubMatches (0) <= CInt (Matches (0). SubMatches (1) Then
'Tag _ Left = Matches (0). SubMatches (0)
'Else
'Tag _ Left = Left (Matches (0). SubMatches (0), Matches (0). SubMatches (1) & Matches (0). SubMatches (2)
'End If
L = len (Matches (0). SubMatches (0 ))
T = 0
For m_ I = 1 To l
C = Abs (Asc (Mid (Matches (0). SubMatches (0), m_ I, 1 )))
If c & gt; 255 Then
T = t + 2
Else
T = t + 1
End If
If t> = 2 * CInt (Matches (0). SubMatches (1) Then
Tsung ag_left = left (Matches (0). SubMatches (0), m_ I) & Matches (0). SubMatches (2)
Exit
Else
Tsung ag_left = Matches (0). SubMatches (0)
End if
Next
End If
Set regEx = Nothing
Set Matches = Nothing
End Function
'Method: format the time format TSYS: format_date (time, 'Time format string ')
'Parameter: Tsys tag
'Return: Truncated string
Private Function t‑ag_format_date (myFlag)
Dim regEx, Matches
Set regEx = New RegExp
RegEx. IgnoreCase = true
RegEx. Global = True
RegEx. MultiLine = True
RegEx. pattern = "([^ \,] {0,}) [\ s] {0,}, [\ s] {0 ,} '([^'] {0 ,})'"
Set Matches = regEx. Execute (myFlag. value)
Dim DateTemplate
DateTemplate = "{Y}-{m}-{d }"
Tsf-ag_format_date = ""
If Matches. Count> 0 Then
If Matches (0). SubMatches (1) <> "Then
DateTemplate = Matches (0). SubMatches (1)
End If
Tsung ag_format_date = FLib. FormatMyDate (Matches (0). SubMatches (0), DateTemplate)
Else
Tsung ag_format_date = myFlag. Value
End If
Set regEx = Nothing
Set Matches = Nothing
End Function
'Method: Clear the html Tag TSYS: filter_html (string)
'Parameter: Tsys tag
'Return: The cleared string
Private Function tshortag_filterhtml (myFlag)
Tsf-ag_filterhtml = ""
If myFlag. Value <> "" Or Not IsNull (myFlag. Value) Then
Tsf-ag_filterhtml = RegReplace ("<. *?> ", MyFlag. Value ,"")
End If
End Function
####### System preset tag library-end ########################## ######################################## ###########
######## User extension tag library-start ########################## ######################################## ###########
'Method: Clear all spaces TSYS: trim (string)
'Parameter: Tsys tag
'Return: The cleared string
Private Function USERTAG_TRIM (myFlag)
USERTAG_TRIM = Trim (myFlag. Value)
End Function
######## User extension tag library-end ########################## ######################################## ###########