手把手教你TSYS建站

      最近好多人对tsys很感兴趣,其实大家不知道的是tsys的asp版本早就已经停止开发了,为了不想让如此优秀的东西被埋没所以我在tsys的asp版本的基础上使用PHP重新开发了一个功能更强的cms,名字是blackhand,这个版本保留了tsys所有的优点,另外屏蔽了tsys的缺点,还增加了诸多很棒的功能,大家如果感兴趣可以看一下.
     另外,因为tsys的asp版本就要求站长会编写asp脚本,同样的,为了灵活性所以呢这个PHP版本就要求站长会写PHP脚本,只有如此才能更灵活,才能用它去做别的cms不敢涉及或永远做不到的功能.这才是tsys的真谛!
PHP版本的tsys浏览页面:http://hi.baidu.com/see7di/blog/item/4daf1955bd555bc8b745ae93.html
PHP版本的tsys下载地址:http://download.csdn.net/source/3248406


目前TSYS最新版本为2.0beta1,而且网络上有不少TSYS加强板,这使用的是官方发布的TSYS1.1正式版,

1。建好你的页面模版。实际上就是建好一个静态的页面,页面板块,形式全是自己定义的,也就可以用TSYS建出形式各样的页面,这也是和其他一些建站系统有所区别的,举例说明:
[code]
<html>
<head>
<style>
a:link   {font:9pt/12pt 宋体, MS Song; color:red}
a:visited   {font:9pt/12pt 宋体, MS Song; color:#4e4e4e}
</style>
<meta HTTP-EQUIV="Content-Type" Content="text-html; charset=gb2312">
<title>从此长大</title>
</head>
<body bgcolor="white">
<table width="400" cellpadding="3" cellspacing="5">
<tr>
    <td id="tablePropsWidth2" width="400" colspan="2">
   <a href=http://www.31u.net>从此长大演示页面</a>
   </td>
</tr>
</table>
<table width="400" cellpadding="3" cellspacing="5">
<tr>
    <td id="tablePropsWidth2" width="400" colspan="2"><font id="LID1"
    style="COLOR: black; FONT: 9pt/12pt 宋体, MS Song"><hr color="#C0C0C0" noshade>
    <p id="LID2">请尝试以下操作:</p><ul>
      <li id="list1">如果您已经在地址栏中输入该网页的地址,请确认其拼写正确。<BR>
      </li>
      <li id="list2">打开 <script> Homepage(); </script> 主页,然后查找指向您感兴趣信息的链接。 </li>
      <li id="list3">单击<a href="javascript:history.back(1)">后退</a>按钮,尝试其他链接。 </li>   
      <li ID="list4">单击搜索,寻找 Internet 上的信息</li>
    </ul>
    <p><br>
    </p>
    <h2 id="ietext" style="font:9pt/12pt 宋体, MS Song; color:black">HTTP 404 - 未找到文件<br>
    Internet Explorer <BR>
    </h2>
    </font></td>
</tr>
</table>
</body>
</html>
[/code]


2。在需要更新的地方使用标签(标签支持中文),如上例子,我要在“单击搜索,寻找 Internet 上的信息”这个地方替换为以后的“国内新闻”这个栏目~~就可以更改为
[code]
<html>
<head>
<style>
a:link   {font:9pt/12pt 宋体, MS Song; color:red}
a:visited   {font:9pt/12pt 宋体, MS Song; color:#4e4e4e}
</style>
<meta HTTP-EQUIV="Content-Type" Content="text-html; charset=gb2312">
<title>从此长大</title>
</head>
<body bgcolor="white">
<table width="400" cellpadding="3" cellspacing="5">
<tr>
    <td id="tablePropsWidth2" width="400" colspan="2">
   <a href=http://www.31u.net>从此长大演示页面</a>
   </td>
</tr>
</table>
<table width="400" cellpadding="3" cellspacing="5">
<tr>
    <td id="tablePropsWidth2" width="400" colspan="2"><font id="LID1"
    style="COLOR: black; FONT: 9pt/12pt 宋体, MS Song"><hr color="#C0C0C0" noshade>
    <p id="LID2">请尝试以下操作:</p><ul>
      <li id="list1">如果您已经在地址栏中输入该网页的地址,请确认其拼写正确。<BR>
      </li>
      <li id="list2">打开 <script> Homepage(); </script> 主页,然后查找指向您感兴趣信息的链接。 </li>
      <li id="list3">单击<a href="javascript:history.back(1)">后退</a>按钮,尝试其他链接。 </li>   
      <li ID="list4">
<!---国内新闻:开始--->
<!---国内新闻:结束--->
</li>
    </ul>
    <p><br>
    </p>
    <h2 id="ietext" style="font:9pt/12pt 宋体, MS Song; color:black">HTTP 404 - 未找到文件<br>
    Internet Explorer <BR>
    </h2>
    </font></td>
</tr>
</table>
</body>
</html>
[/code]

3。在TSYS后台添加“国内新闻”这个频道,可以看到它有个ID号,等会用的上的

4。在Tsys\Manage\UpdateSite中有系统自带的page01.asp......等4个用于游戏演示站的更新文件~~我们选择其中一个page01.asp,修改其中的代码为
[code]
<%Option Explicit%>
<!--#include file="../Include/Config.asp" -->
<!--#include file="../Include/Tkl_SYSProedomClass.asp" -->
<!--#include file="../Include/ClassList_Fun.asp" -->
<!--#include file="../Include/CreateFile_Fun.asp" -->
<!--#include file="../Include/Tkl_StringClass.asp" -->
<!--#include file="../Include/Tkl_TemplateClass.asp" -->
<!--#Include File="../Include/OnlineClass.asp" -->
<!--#Include File="../Include/UpdateAdminTime.asp" -->
<%
'////////////////////////////////////////////////////////////////////
'//本页:
'//生成index.htm首页内容
'////////////////////////////////////////////////////////////////////

Dim SysAdmin
Set SysAdmin=New SYSProedom_Class
If Not CBool(SysAdmin.Logined) Then
    Response.Write "<script>top.location='login.asp'</script>"
End If

If Not SysAdmin.UpdatePage Then
    Response.Write("<script>alert(""<操作失败>\n你的权限不足"& Def_SoftCopyright_Script &""");window.history.back();</script>")
    Response.End()
End If

Call UpdateAdminTime()

Dim Conn
Set Conn = Server.CreateObject("Adodb.Connection")
    Conn.Open ConnStr

Dim StrClass
Set StrClass = New Tkl_StringClass

Select Case Request("Work")
    Case "Update01" :
        Update01()
        UpdateOk()
    Case "All" :
        Update01()
        UpdateOk()
End Select

'//更新成功提示
Function UpdateOk()
    Response.Write("<script>alert(""<操作成功>\n页面更新成功"& Def_SoftCopyright_Script &""");window.history.back();</script>")
    Response.End()
End Function

'//国内新闻
Function Update01()
    Dim TemplateFilePath
        TemplateFilePath=Server.MapPath("../../../index.htm")  
'////////////////////////////////////////////////////////////////////
'//../../../index.htm
'//以上路径,名称一定要设对,否则会报错
'////////////////////////////////////////////////////////////////////
    Dim TClass,strHtml
    Set TClass=New Tkl_TemplateClass
        strHtml=""
    Dim Rs,Sql
        Sql="Select Top 8 Title,FilePath,AddTime From view_NewsInfo Where Class In (34" & AllChildClass(34) & ") Order By Id DESC"
'////////////////////////////////////////////////////////////////////
'//红色的部分改为刚添加频道时系统给的ID号~~
'//蓝色的部分为要显示的新闻条数~~
'////////////////////////////////////////////////////////////////////

    Set Rs=Conn.ExeCute(Sql)
    While Not Rs.Eof
        strHtml=strHtml&"·[" & StrClass.FormatMyDate(Rs("AddTime"),"{m}/{d}") & "]<a href=""" & Rs("FilePath") & """ target=""_blank"">" & Rs("Title") & "</a><br>" & vbCrLf
'////////////////////////////////////////////////////////////////////
'//以上为自定义输出方式
'////////////////////////////////////////////////////////////////////
        Rs.MoveNext
    Wend
    Rs.Close
    Set Rs=Nothing

    With TClass
        .OpenTemplate(TemplateFilePath)
        .StartElement="<!---国内新闻:开始--->"
        .EndElement="<!---国内新闻:结束--->"
'////////////////////////////////////////////////////////////////////
'//改为和你使用的标签一致
'////////////////////////////////////////////////////////////////////
        .Value=strHtml
        .ReplaceTemplate()
        .Save()
    End With
    Set TClass=Nothing
End Function
%>
[/code]

4。OK了~~在tsys后台“资源管理”里添加文章~~因为只是用了1.1正式版演示的后台,所以在添加文章时记得选“国内新闻”,然后在“站点更新”“页面资源更新”的第一个里选择全部更新~~现在去你刚建的网页刷新下~~是不是显示了刚才的文章?~

posted @ 2008-04-23 19:19  已經停更  阅读(203)  评论(0编辑  收藏  举报