这次发的应该不会有问题了,不过在录制过程中把SQL语句搞错了一点点,少了日期排序,以文本为准,最终SQL语句我写在下面了,大家可以看看,有问题可以联系QQ:67663233。
效果:
相关文件
CSS文件:
#toptitle{
border:1px;
border-style:solid;
width:250px;
height: 100px;
}
.topTitle_title{
font-size:16px;
font-family: 黑体;
color: Red;
text-align: center;
padding-top:5px;
}
.topTitle_Title A:link
{
font-size:16px;
font-family: 黑体;
color: Red;
text-align: center;
text-decoration: none
}
.topTitle_Title A:visited
{
font-size:16px;
font-family: 黑体;
color: Red;
text-align: center;
text-decoration: none
}
.topTitle_content{
padding-top:10px;
text-indent: 24;/*首行缩进*/
font-size:12px;
color: Navy;
}
.topTitle_content a:link{
padding-top:10px;
text-indent: 24;/*首行缩进*/
font-size:12px;
color: Navy;
text-decoration: none;/*不加下划线*/
}
.topTitle_content a:visited{
padding-top:10px;
text-indent: 24;/*首行缩进*/
font-size:12px;
color: Navy;
text-decoration: none;/*不加下划线*/
}
HTML文件:
<html>
<head><title>无标题文档</title>
<meta http-equiv=Content-Type content="text/html; charset=gb2312">
<link href="{$GetSiteUrl}test/css.css" type=text/css rel=stylesheet>
</head>
<body >{SQL_今日头条()} </body>
</html>
今日头条自定义函数标签内容:
<div id="toptitle">[loop=1]
<div class="toptitle_Title"><a href="{$Field(id,GetInfoUrl,1,1)}">{$Field(title,Text,20,,0,)}</a></div>
<div class="divsplit"></div>
<div class="toptitle_content"><a href="{$Field(id,GetInfoUrl,1,1)}">{$Field(intro,Text,100,...,0,)}</a></div>[/loop] </div>
最终SQL语句:
select top 1 ID,title,Adddate,Intro,Strip from KS_Article where Strip=true order by Adddate desc
请大家对照教程看看吧!有问题就Q我!!
演示地址:http://www.51slim.net/kesion.htm
教程下载:http://www.51slim.net/kesion.swf
[此贴子已经被作者于2006-11-17 9:10:06编辑过]