Discuz!官方免费开源建站系统

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[原创]一楼和二楼之间插入论坛公告

[复制链接]
lu5266 发表于 2005-9-22 21:50:49 | 显示全部楼层 |阅读模式
插件名称:一楼和二楼之间插入论坛公告
插件作者: lu5266
修改文件: viewthread.php  include/cache.php
修改模板: viewthread.htm
演示:http://free4.e-168.cn/luzhenling ... =538&fpage=1#f2



安装方法:

1:修改include/cache.php

查找:

  1. 'smilies'
复制代码


在后面加上:

  1. ,'announcements'
复制代码


2:修改viewthread.php

查找:

  1. include template('viewthread');
复制代码


在上面加上:

  1. //==============每页的一.二楼的之间的公告 start by lu5266========
  2.         $announcements = '';
  3.         if($_DCACHE['announcements']) {
  4.                 $space = '';
  5.                 foreach($_DCACHE['announcements'] as $announcement) {
  6.                         if($timestamp >= $announcement['starttime'] && ($timestamp <= $announcement['endtime'] || !$announcement['endtime'])) {
  7.                                 if ($announcement['posturl']){
  8.                                         $announcements .= $space.'<img src="images/dog.gif"><a href="'.$announcement['posturl'].'" target="_blank"><span class="bold">'.$announcement['subject'].'</span> '.
  9.                                         '('.gmdate($dateformat, $announcement['starttime'] + $timeoffset * 3600).')</a>';
  10.                                 }else{
  11.                                         $announcements .=$space.'<img src="images/dog.gif"><a href="announcement.php?id='.$announcement['id'].'#'.$announcement['id'].'" target="_blank"><span class="bold">'.$announcement['subject'].'</span> '.
  12.                                         '('.gmdate($dateformat, $announcement['starttime'] + $timeoffset * 3600).')</a>';
  13.                                 }
  14.                                 $space = '&nbsp; &nbsp; &nbsp; &nbsp;';
  15.                         }
  16.                 }
  17.         }
  18.         unset($_DCACHE['announcements']);
  19. //===========每页的一.二楼的之间的公告 end by www.5466.ik8.com====
复制代码



3:修改模板viewthread.htm

查找:

  1.         <!--{/loop}-->
  2. </table></td></tr></table>
复制代码


在上面加上:

  1.         <!--{if $post['postcount']==1 || $post['postcount']==($ppp*($page-1)+1)}-->

  2. <tr ><td align="center"><font style="filter: glow(color=#ff0055,strength=2); height:20px; color: #ffffff">$bbname ★{lang index_announcements}★</font></td><td  align="center"  bgcolor="{ALTBG1}">
  3.         <!--{if empty($announcements)}-->
  4.                 {lang index_noannouncement}
  5.         <!--{else}-->
  6.                 <marquee direction="left" scrollamount="3" onMouseOver="this.stop();" onMouseOut="this.start();">
  7.                 $announcements
  8.                 </marquee>
  9.         <!--{/if}-->
  10. </td></tr>
  11.          <!--{/if}-->
复制代码


4:更新缓存(必须,否则看不到效果)



成功的话,顶下哦

截图:




[ 本帖最后由 lu5266 于 2005-9-22 22:00 编辑 ]
ygm007 发表于 2005-9-22 21:56:01 | 显示全部楼层
我坐沙发顶
回复

使用道具 举报

 楼主| lu5266 发表于 2005-9-22 21:59:50 | 显示全部楼层
截图

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

x
回复

使用道具 举报

 楼主| lu5266 发表于 2005-9-22 22:01:44 | 显示全部楼层
原帖由 ygm007 于 2005-9-22 21:56 发表
我坐沙发顶


呵呵
回复

使用道具 举报

秋舞叶 发表于 2005-9-22 22:06:44 | 显示全部楼层
我从来没坐过沙发,给你们架起来
回复

使用道具 举报

jimmyjimmyqqq 发表于 2005-9-22 22:35:54 | 显示全部楼层
沙發,沒有了。支持lu5266!強!Cache版本!
回复

使用道具 举报

jimmyjimmyqqq 发表于 2005-9-22 22:37:16 | 显示全部楼层
Lu,我想開論壇,沒有空間,可有免費的提供一下呀?
回复

使用道具 举报

 楼主| lu5266 发表于 2005-9-23 06:45:43 | 显示全部楼层
原帖由 秋舞叶 于 2005-9-22 22:06 发表
我从来没坐过沙发,给你们架起来

回复

使用道具 举报

 楼主| lu5266 发表于 2005-9-23 06:46:11 | 显示全部楼层
原帖由 jimmyjimmyqqq 于 2005-9-22 22:35 发表
沙發,沒有了。支持lu5266!強!Cache版本!


回复

使用道具 举报

 楼主| lu5266 发表于 2005-9-23 06:46:27 | 显示全部楼层
原帖由 jimmyjimmyqqq 于 2005-9-22 22:37 发表
Lu,我想開論壇,沒有空間,可有免費的提供一下呀?

pm给你了
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|Discuz! 官方站 ( 皖ICP备16010102号 )star

GMT+8, 2024-5-21 20:21 , Processed in 0.104854 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回复 返回顶部 返回列表