您当前位置:首页 > 文章中心 > SCSCMS

太阳光飞腾讲解第二课

稿件来源: 太阳光网页设计   撰稿作者: 太阳光   发表日期: 2008-11-07 18:40:33   阅读次数: 1119   查看权限: 游客查看

飞腾aspCMS基本知识讲解


公用顶部top

 


今天是周五,明天放假,最近也比较忙,所以今天抽点时间写点教程。根据最近Q群常常有人问及网页顶部图片换成FLASH问题,来讲一下公用顶部top的内容。
上节课已经讲到公用顶部top 在ASP代码中就是 head() 那么他实际代码是什么呢,大家打开inc/Ft_function.asp 在最前面就解析了head()函数
'==================================
'=函 数 名:head()
'=功    能:页面头部信息显示
'==================================
Function head()
 Dim str
 str=Replace(m_top,"$css$",m_css)
 str=Replace(str,"$webname$",webname)
 str=Replace(str,"$webkeyword$",webkeyword)
 str=Replace(str,"$webboss$",webboss)
 str=Replace(str,"$weburl$",weburl)
 str=Replace(str,"$webemail$",webemail)
 str=Replace(str,"$sub_title$",sub_title)
 If Instr(str,"$menu$")<>0 Then str=Replace(str,"$menu$",Getmenu())
 head=str
End Function

这里都是Replace()替换函数(如果不懂这个函数的请查百度) 首先有m_top变量,在这里我们是看不到它的具体内容,这得转到inc/Ft_lib.asp文件可以找到m_top=Replace(StrTemp(1),"{PicUrl}",SignImgPath)它就是风格模板的的top内容,具体HTML代码是什么呢,这你就要进入后台-外观设置-网站界面风格总管理-总风格模板(tamplate.main) 其中[页面开始部分top(1)]就是m_top的真实内容:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="
http://www.w3.org/1999/xhtml">
<head>
<link rel="shortcut icon" href="favicon.ico">
<link rel="bookmark" href="favicon.ico">
<title>$sub_title$-$webname$|太阳光设计|网页制作</title>
<meta http-equiv="content-type" content="text/html; charset=gb2312">
<meta name="keywords" content="$sub_title$,$webkeyword$">
$css$
<script type="text/JavaScript" language="javascript" src="inc/Ft_incjs.js"></script>
<script type="text/JavaScript" language="javascript">if(self!=top){top.location=self.location;}</script>
</head>
<body>
<div id="page_w">
<div id="menu"><div style="text-align:right;width:240px;float:right;"><a href="#" style="cursor:hand;" onClick="this.style.behavior='url(#default#homepage)';this.setHomePage('$weburl$');">设为首页</a> | <a style="cursor:hand;"  href="javascript:window.external.addFavorite('$weburl$','$webname$');">加入收藏</a> | <a style="cursor:hand;" href="
mailto:$webemail$" Title='给站长写信'>联系站长</a> &nbsp; </div>$menu$ </div>
<div id="top"><img src="{PicUrl}/weblogo.gif" alt="网站标志" border="0" style="margin-top:20px;float:left;"></div>
<!--会员登录调用-->
<div class="top_bg"><div class="top_title">会员快速登录</div>
<div id="ft_user">登陆加载中...</div></div>
<div class="line"></div>
<!--公告调用-->
<div class="top_bg"><div class="top_title">网站最新公告</div>
<div style="margin-left:7px;"><div id="xzy" style="filter: progid:DXImageTransform.Microsoft.GradientWipe(GradientSize=0.5 Duration=3);padding-top:5px;">公告加载中...</div>$titlediary_up$</div></div>
<div class="line"></div>

我们返回开始部分看head()函数,第一句是 str=Replace(m_top,"$css$",m_css) 意思就是替换顶部内容的$css$为m_css的内容,而m_css内容就是总风格模板里的[CSS管理CSS(0)]

其他代码意思如下:
 str=Replace(str,"$webname$",webname) //替换为真正的网站名称
 str=Replace(str,"$webkeyword$",webkeyword)//替换为真正的网站关键字
 str=Replace(str,"$webboss$",webboss)//替换为真正的站长名
 str=Replace(str,"$weburl$",weburl)//替换为真正的网页域名
 str=Replace(str,"$webemail$",webemail)//替换为直接的站长邮箱
 str=Replace(str,"$sub_title$",sub_title)//替换为IE显示的标题(其中sub_title变量在每个ASP文件里直接定义)
 If Instr(str,"$menu$")<>0 Then str=Replace(str,"$menu$",Getmenu())//如果存在菜单标签,就替换为真正的菜单

到此网站的head()函数加载完成。

下面就讲一下怎么换网站LOGO图片为FLASH,我们从上面模板中可以找到代码<div id="top"><img src="{PicUrl}/weblogo.gif" alt="网站标志" border="0" style="margin-top:20px;float:left;"></div>就是我们需要修改的地方,其中有id="top",这里有一张大图片,很多Q友无法找到图片,其实是在CSS里:
#top{/*顶部banner*/
 height:130px;
 background-image: url('{PicUrl}/top.jpg');//大背景图片,如果不要删除这句即可
 border:1px solid #5BC514;
 border-width:0px 1px 0px 1px;
 background-repeat:no-repeat;
}

<img src="{PicUrl}/weblogo.gif" alt="网站标志" border="0" style="margin-top:20px;float:left;">就是LOGO图片,我们把它换成FLASH插入网页的代码即可,不过要注意FLASH的大小。假如你的是1.swf 那么就把<div id="top"><img src="{PicUrl}/weblogo.gif" alt="网站标志" border="0" style="margin-top:20px;float:left;"></div>换成:

 <div id="top"> <script type="text/javascript">CreateFlash("#FFFFFF","1.swf",960,130,""); </script>  </div>

在此特别说明,因为CreateFlash()函数是本站js文件已经定义插入FLASH的代码,不是所有网页适合用,当然你用原完成插入FLASH代码也可以!今天到此,谢谢大家!

关键词: 飞腾讲解   编辑时间: 2010-03-12 9:08:30

  • 感到高兴

    2

    高兴
  • 感到支持

    1

    支持
  • 感到搞笑

    0

    搞笑
  • 感到不解

    0

    不解
  • 感到谎言

    0

    谎言
  • 感到枪稿

    0

    枪稿
  • 感到震惊

    0

    震惊
  • 感到无奈

    0

    无奈
  • 感到无聊

    0

    无聊
  • 感到反对

    0

    反对
  • 感到愤怒

    0

    愤怒
66.67%(2)
33.33%(1)
共有0 条评论 发言请遵守【相关规定

网友评论

会员头像
发 表同步腾讯微博    验证码:  点击更新请先登陆
  • 暂无评论
关闭模块文章图片 article Pictrue
  • 我的妈妈爸爸
  • 基于koa2+mysql+vue2.0+Element阳光内容管理系统
  • 代码覆盖率工具 Istanbul 入门教程
  • 全栈工程师的武器——MEAN
  • 9款超炫的 CSS3 复选框(Checkbox)
  • 微信开发在线翻译功能
  • CSS3那些不为人知的高级属性
  • 给easyui的datebox添加清空事件
  • flash写字效果
  • kendoUI系列教程之DropDownList下拉菜单
  • kendoUI系列教程之datetimepicker日期时间选择
  • kendoUI系列教程之datepicker日期选择
  • kendoUI系列教程之combobox下拉列表框
  • kendoUI系列教程之colorpicker
  • kendoUI系列教程之calendar日历表
  • kendoUI系列教程之autocomplete自动补齐