您现在的位置: 阿标在线 >> 技术文章 >> 本站作品 >> 动力3.62相关 >> 正文

让3.62不同频道实现不同风格的Top和Bottom!

[ 录入:chinar | 点击数: | 更新时间:2005-8-7 19:25:00]

以添加文章频道的Top和Bottom为例,其他依次类推:

(一)进入后台“网站模板管理----当前模板主模块(Main_Style)  -----界面风格 ",

1、添加nt2003.mainhtml(5)(其实就是将nt2003.mainhtml(2)中的内容复制过来)

 

<!-- Top(文章频道)顶部表格 -->
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td class="nav_top"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="90"><img src="Skin/51dsn03/top_word.gif" width="180" height="20"></td>
        <td align="right"><font color="#FFFFFF">{$channel}</font></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td height="28" class="nav_menu">{$ClassMenu}</td>
  </tr>
  <tr>
    <td class="nav_main">&nbsp;</td>
  </tr>
  <tr>
    <td class="nav_ann"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="20"><img src="Skin/51dsn03/h_an1.gif" width="20" height="20"></td>
        <td width="10">&nbsp;</td>
        <td width="70"><font color="#0560A6">最新公告</font>:</td>
        <td><MARQUEE scrollAmount=1 scrollDelay=4 width=500
            align="left" onmouseover="this.stop()" onmouseout="this.start()">{$ShowAnnounce} </MARQUEE></td>
        <td width="120" align="right"><a href="#" onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('{$SiteUrl}')">设为首页</a> | <a href="javascript:window.external.addFavorite('{$SiteUrl}','{$SiteName}')">加入收藏</a></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td class="txt_css"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="20"><img src="Skin/51dsn03/h_ar1.gif" width="20" height="20"></td>
        <td width="10">&nbsp;</td>
        <td><font color="#FFFFFF">{$path}</font></td>
        <td width="200" align="right"><div id="jnkc"></div>
          <script>setInterval("jnkc.innerHTML=new Date().toLocaleString()+' 星期'+'日一二三四五六'.charAt (new Date().getDay());",1000);</script></td>
      </tr>
    </table></td>
  </tr>
</table>

 

1、添加nt2003.mainhtml(6)(其实就是将nt2003.mainhtml(3)中的内容复制过来)

 

<!-- Bottom(文章频道)底部表格 -->
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0" class="nav_bottom">
  <tr>
    <td><a href="aboutwebsite.asp" target="_blank">关于本站</a> | <a href="mailt{$webmastemail}">联系站长</a> | <a href="FriendSite.asp" target="_blank">友情链接</a> | <a href="Copyright.asp" target="_blank">版权申明</a> | <a href="Admin_Index.asp" target="_blank">管理登陆</a></td>
  </tr>
  <tr>
    <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>{$copyright}&nbsp;&nbsp;站长:{$webmaster}</td>
        <td width="150" align="right"><img src="Skin/51dsn03/bottom_logo1.gif" width="141" height="8"></td>
      </tr>
    </table></td>
  </tr>
  <tr>
    <td><table width="100%"  border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>Powered by:{$powered}&nbsp;&nbsp;&nbsp;&nbsp;{$runtime}{$SqlQueryNum}&nbsp;&nbsp;&nbsp;&nbsp;<font color="#999999" onmousemove="this.color='#FF0000';" onmouseout="this.color='#999999';" >当前模版:[{$StyleName}]</font></td>
        <td align="right"></td>
      </tr>
    </table></td>
  </tr>
</table>

 

保存即可!

 

(二)打开function.asp ,在

 

Public Sub bottom()
  Dim strtmp
  strtmp = mainhtml(3)
  If Site_Setting(0) = "1" Then '是否显示网站运行时间
   Dim Endtime
   Endtime = Timer()
   strtmp = Replace(strtmp,"{$runtime}","执行时间:" & CStr(FormatNumber((Timer-BeginTime)*1000,2)) & " 毫秒")
  Else
   strtmp = Replace(strtmp,"{$runtime}","")
  End If
  strtmp = Replace(strtmp,"{$width}",mainsetting(0))
  strtmp = Replace(strtmp,"{$PicUrl}",Site_PicUrl)
  strtmp = Replace(strtmp,"{$powered}",Site_Version)
  strtmp = Replace(strtmp,"{$copyright}",Site_Info(9))
  strtmp = Replace(strtmp,"{$webmaster}",Site_Info(7))
  strtmp = Replace(strtmp,"{$webmastemail}",site_info(8))
  strtmp = Replace(strtmp,"{$StyleName}",StyleName)
  strtmp = Replace(strtmp,"{$SqlQueryNum}"," | 查询数据库:"&SqlQueryNum&" 次")
  strtmp = strtmp & mainhtml(4)
  Response.Write strtmp
End Sub

 

下边添加如下内容:

 

'---------页面显示类函数(文章频道)
Public Sub head_Article()
  Name="head" & ChannelID & ClassID & PageTitle
  '取当前路径
  if PageTitle<>"" then
      strPageTitle=strPageTitle & " >> " & PageTitle
   strPath=strPath & "&nbsp;&gt;&gt;&nbsp;" & PageTitle
  end if
  If ObjIsEmpty() Then
   value = Replace(Replace(Replace(Replace(mainhtml(1),"{$sitename}",Site_info(0)),"{$keyword}",Replace(Site_info(2),"|",",")),"{$description}",Site_info(3)),"{$Site_CSS}",Site_CSS)&vbNewLine
  End If
  value = Replace(value,"{$strPageTitle}",strPageTitle)
     if nt2003.Site_Setting(43)=1 then
     value = Replace(value,"{$EstopRight}"," oncontextmenu='return false' ondragstart='return false' onselectstart ='return false' ")
  else
     value = Replace(value,"{$EstopRight}","")
  end if
  Response.Write value     '写入HTTP头

 

  dim strtmp,strrow,strcol,channelstr,i,j
  if Site_Setting(2)=1 then
   channelstr="|&nbsp;"
   Name="channel"
   If ObjIsEmpty() Then loadchannel()
   strrow=Split(value,"@@@")
   For i = 0 to UBound(strrow)-1
    strcol=Split(strrow(i),"|||")
    'Sp2新增频道打开方式一枝梅
    if strcol(3)=1 then
    channelstr=channelstr & "<a href=" & strcol(2) &" class=Channel target='_blank'>"
    else
    channelstr=channelstr & "<a href=" & strcol(2) &" class=Channel>"
                end if
    if strcol(1)="" then
        channelstr=channelstr & strcol(0)
    else
        channelstr=channelstr & "<img src="&strcol(1)&">"
    end if
    channelstr=channelstr & "</a>&nbsp;|&nbsp;"
   next
  else
   channelstr=""
  end if
  strtmp = Replace(mainhtml(5),"{$channel}",channelstr)

 

  Name="classlist"&ChannelID
  If ObjIsEmpty() Then loadclasslist()
  strtmp = Replace(strtmp,"{$ClassMenu}",value)
  strtmp = Replace(strtmp,"{$width}",mainsetting(0))
  strtmp = Replace(strtmp,"{$PicUrl}",Site_PicUrl)
  strtmp = Replace(strtmp,"{$ShowAnnounce}",Announcestr(2,5))
  strtmp = Replace(strtmp,"{$SiteUrl}",nt2003.site_info(4))
  strtmp = Replace(strtmp,"{$SiteName}",nt2003.site_info(0))
  strtmp = Replace(strtmp,"{$webmastemail}",nt2003.site_info(8))
  strtmp = Replace(strtmp,"{$path}",strPath)
  strtmp = Replace(strtmp,"{$Logo}",ShowLogo)
  strtmp = Replace(strtmp,"{$Banner}",ShowBanner)
  strtmp = Replace(strtmp,"{$ShowAD1}",ShowAD(1))
  Response.Write strtmp '写入head表格
  End Sub

 

Public Sub bottom_Article()
  Dim strtmp
  strtmp = mainhtml(6)
  If Site_Setting(0) = "1" Then '是否显示网站运行时间
   Dim Endtime
   Endtime = Timer()
   strtmp = Replace(strtmp,"{$runtime}","执行时间:" & CStr(FormatNumber((Timer-BeginTime)*1000,2)) & " 毫秒")
  Else
   strtmp = Replace(strtmp,"{$runtime}","")
  End If
  strtmp = Replace(strtmp,"{$width}",mainsetting(0))
  strtmp = Replace(strtmp,"{$PicUrl}",Site_PicUrl)
  strtmp = Replace(strtmp,"{$powered}",Site_Version)
  strtmp = Replace(strtmp,"{$copyright}",Site_Info(9))
  strtmp = Replace(strtmp,"{$webmaster}",Site_Info(7))
  strtmp = Replace(strtmp,"{$webmastemail}",site_info(8))
  strtmp = Replace(strtmp,"{$StyleName}",StyleName)
  strtmp = Replace(strtmp,"{$SqlQueryNum}"," | 查询数据库:"&SqlQueryNum&" 次")
  strtmp = strtmp & mainhtml(4)
  Response.Write strtmp
End Sub
'---------页面显示类函数(文章频道)

 

注意:红色语句中的兰色数字应与后台nt2003.mainhtml(5)、nt2003.mainhtml(6)中的数字一致。

 

(三)修改所有文章频道(Article开头的ASP文件),将开头处

 

nt2003.head()修改为:nt2003.head_Article()

 

将结尾处的

 

nt2003.bottom()修改为:nt2003.bottom_Article()

 


  • 上一篇文章:

  • 下一篇文章: