RSS  WAP  简体中文  繁体中文  English  
高级搜索
游客:注册    ;用户登录 搜索  论坛首页  
您现在的位置:网站引擎产品论坛SiteEngine心得交流不同频道,插入相同/不同的模块类别,实现不
您好,  积分:,您有0条新站内短信 最新帖子
  
主题: 不同频道,插入相同/不同的模块类别,实现不 上一主题  下一主题
作者:
主题: 不同频道,插入相同/不同的模块类别,实现不
九天鹰


专业版

Level: 29
HP: 578 / 790
MP: 154 / 893
Exp: 23%

帖子: 231
积分: 609
注册时间: 2006-01-23
1楼
以下方法可以实现:
不同频道,插入相同/不同的模块类别,实现不同的显示样式

我们都知道,在频道里插入列表,调用的是***_scripts.html模板,如果在不同的频道里显示不同的样式,我们可能会想到在模板里做判断,但是实际中应用时可能不行,以下方法可以解决这个问题.

在频道里插入列表,格式类似如下

  :[]  
[ info ]lang=chinese|temp=chinese|classid=1|module=news|substr=30|numperpage=10|morelink=1|showtime=0|row=1|images=0|photonews=0|showlist=1|showtitle=1|showwidth=120|showheight=120|color=|classname=0|showsummary=0|action=new|shownum=2|child=2|type=1|max=10[ /info ]

假设我们现在有3个频道
每个频道里插入上面的代码,但是我们需要改一些地方

需要在 max=10后面自己加一个参数 flying=aaa
flying和aaa是随便起的,但是要保证每个频道里flying的值(也就是aaa)不一样,另外最重要的,还要保证其他的也要有所区别,例如每个频道里的substr=30的值改变一下

假设修改后三个频道的值为

  :[]  
[ info ]lang=chinese|temp=chinese|classid=1|module=news|substr=30|numperpage=10|morelink=1|showtime=0|row=1|images=0|photonews=0|showlist=1|showtitle=1|showwidth=120|showheight=120|color=|classname=0|showsummary=0|action=new|shownum=2|child=2|type=1|max=10|flying=aaa[ /info ]

[ info ]lang=chinese|temp=chinese|classid=1|module=news|substr=32|numperpage=10|morelink=1|showtime=0|row=1|images=0|photonews=0|showlist=1|showtitle=1|showwidth=120|showheight=120|color=|classname=0|showsummary=0|action=new|shownum=2|child=2|type=1|max=10|flying=bbb[ /info ]

[ info ]lang=chinese|temp=chinese|classid=1|module=news|substr=34|numperpage=10|morelink=1|showtime=0|row=1|images=0|photonews=0|showlist=1|showtitle=1|showwidth=120|showheight=120|color=|classname=0|showsummary=0|action=new|shownum=2|child=2|type=1|max=10|flying=ccc[ /info ]

注意,每个频道里info的值有两个地方不一样,分别是
substr=30   flying=aaa
substr=32   flying=bbb
substr=34   flying=ccc


然后我们修改 news_scripts.html模板

  :[]  
[if($flying == 'aaa')][then]
$classname aaa $title$new  $time

[/then][else]
[if($flying == 'bbb')][then]
$classname bbb $title$new  $time

[/then][else]
$classname ccc $title$new  $time

[/else][/if]
[/else][/if]

运行后就会得到不一样的结果(标题前面的字符不一样)



07-2-7 10:59 1楼
  插入邮件地址  发短消息     回复
colorwind

Moderate

标准版

Level: 27
HP: 425 / 743
MP: 113 / 835
Exp: 53%

帖子: 170
积分: 337
注册时间: 2006-03-22
2楼
很为实用~!~!



07-2-28 15:25 2楼
  插入邮件地址  发短消息     回复
asosky [比你大一岁]


免费版

Level: 14
HP: 60 / 371
MP: 15 / 183
Exp: 25%

帖子: 24
积分: 48
注册时间: 2008-01-03
3楼
有用,赞一个````



08-1-3 16:48 3楼
  插入邮件地址  发短消息     回复
     
© 2002 - 2007 BOKAVAN Inc. All Rights Reserved  博卡先锋 版权所有  京ICP备06013158