Jan 31

改进系统函数 GetArticleList(2月1日更新) 晴

阵风 , 18:30 , 动易 , 评论(0) , 引用(0) , 阅读(706) , Via 本站原创 | |
使用函数 GetArticleList 显示文章标题等信息时,如果采用表格式或分多列显示,有时会有问题。例如,共21篇文章的标题信息,分4列显示,结果代码少了3对
<td>
,造成显示效果上的瑕疵。如下图:点击在新窗口中浏览此图片

以PowerEasy® SiteWeaver™ CMS 6.5 Build 0128为例,修改Include/PowerEasy.Article.asp,将Function GetArticleList中的如下代码
If ShowType = 2 Or Cols > 1 Then
        strInfoList = strInfoList & "</tr></table>"
替换为
    If ShowType = 2 Or Cols > 1 Then
      ZZF_remainder=Cols-(iCount Mod Cols)
      If ZZF_remainder<Cols
             If iCount Mod 2 = 0 Then
                CssName = CssName1
             Else
               CssName = CssName2
             End If
            Do while ZZF_remainder>0
                strInfoList = strInfoList & "<td valign='top' class='" & CssName & "'>&nbsp;</td>"  
                ZZF_remainder=ZZF_remainder-1
            Loop
     End If
        strInfoList = strInfoList & "</tr></table>"


当然,要在前面补充定义变量 ZZF_remainder。

修改后效果图如下:
点击在新窗口中浏览此图片

昨天写本文时,忘了考虑ZZF_remainder等于Cols的情况,导致求余为零时出错,刚才又添加了判断
      If ZZF_remainder<Cols
******************
     End If
(更新于2008-02-01 17:34)。
发表评论
表情
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
记住我
昵称   密码   游客无需密码
网址   电邮   [注册]