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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[插件] 首页四格(访客信息+论坛信息+最新发表+最新回复)for DZ4.1

[复制链接]
laoniu 发表于 2006-4-1 12:48:31 | 显示全部楼层 |阅读模式
程序名称:在首页显示 ip地址、访问地点、浏览器、操作系统
运行平台: Discuz! 4.1.0
程序作者: Laoniu(修改自4.0首页四格+魔焰男孩的显示访客信息)
修改文件: index.php
修改模板: index.htm
增加文件: userinfo.inc.php,hot_topics.htm
数据升级: 无
增加查询: 2
程序演示http://www.lnjy.cn/bbs


1、上传附件中的两个文件到论坛相应目录;

2、修改index.php
查找:
  1. require_once './include/common.inc.php';
复制代码

下面加:
  1. require_once './include/userinfo.inc.php';
复制代码


查找:
  1. } else {
  2.         $showoldetails = false;
  3. }
复制代码

下面加:
  1. //首页热门贴 Start
  2. $hack_subject_len=34; //每个标题最多显示得字数
  3. $hack_subject_num=10; //需要显示记录数
  4. //最新贴
  5. $query = $db->query("SELECT dateline,tid,subject,author,views,replies FROM {$tablepre}threads ORDER BY dateline DESC LIMIT 0, $hack_subject_num");
  6. while($thread = $db->fetch_array($query)) {
  7.          $thread[subject0]=$thread[subject];
  8.         $thread['subject'] = cutstr($thread['subject'], $hack_subject_len);
  9.         $hack_newthreads_threadlist[] = $thread;
  10. }


  11. $threadview = $threadreply = array();

  12. //最新回复
  13. $query = $db->query("SELECT replies, tid, subject,author,views,lastposter FROM {$tablepre}threads where replies !=0 ORDER BY lastpost DESC LIMIT 0, $hack_subject_num");
  14.         while($thread = $db->fetch_array($query)) {
  15.                  $thread[subject0]=$thread[subject];
  16.                 $thread[subject] = cutstr($thread[subject], $hack_subject_len);
  17.                 $threadreply[] = $thread;
  18.         }
  19. //首页热门贴 End
复制代码


查找:
  1. $newthreads = round(($timestamp - $lastvisit + 600) / 1000) * 1000;
复制代码

下面加:
  1. $today  = mktime (0,0,0,date("m")  ,date("d"),date("Y"));
  2. $build_date = mktime (0,0,0,03,31,2006);//请修改后面的三个数字,分别代表你论坛运行第一天的月,日,年。
  3. $build_days = (int)(($today-$build_date)/(24*3600));
复制代码


3、修改index.htm
查找:
  1. <table cellspacing="{TABLESPACE}" cellpadding="0" border="0" width="{TABLEWIDTH}" align="center" class="outertxt">
  2. <tr><td class="smalltxt">
  3. {lang timenow} $currenttime, {lang your_lastvisit} $lastvisittime<br>
  4. {lang credits}: <span class="bold">$credits</span>
  5. <!--{loop $extcredits $id $credit}-->
  6.         $credit[title]: <span class="bold">$GLOBALS[extcredits.$id]</span>$credit[unit]
  7. <!--{/loop}-->
  8. / {lang index_status}:
  9. <!--{if $validdays}--><a href="member.php?action=groupexpiry"><span class="bold">$grouptitle</span>($validdays)</a><!--{else}--><span class="bold">$grouptitle</span><!--{/if}-->
  10. <!--{if !empty($invisible)}--> / {lang login_invisible_mode}<!--{/if}-->
  11. </td><td align="right" nowrap class="smalltxt">
  12. <a href="search.php?srchfrom=$newthreads&searchsubmit=yes">{lang show_newthreads}</a> |
  13. <!--{if $discuz_uid}-->
  14.         <a href="search.php?srchuid=$discuz_uid&mytopics=yes&searchsubmit=yes">{lang show_mytopics}</a> |
  15.         <!--{if $allowuseblog}-->
  16.                 <a href="blog.php?uid=$discuz_uid" target="_blank">{lang blog}</a> |
  17.         <!--{/if}-->
  18. <!--{/if}-->
  19. <a href="digest.php">{lang digest}</a> |
  20. <a href="member.php?action=markread">{lang mark_read}</a>
  21. | {lang welcome_newmember} <a href="viewpro.php?username=$memberenc"><span class="bold">$lastmember</span></a><br>
  22. {lang total} <span class="bold">$threads</span> {lang index_threads} / <span class="bold">$posts</span> {lang index_posts} / {lang index_today} <span class="bold">$todayposts</span> {lang index_posts} / <span class="bold">$totalmembers</span> {lang index_members}
  23. </td></tr></table>
复制代码

替换成:
  1. {template hot_topics}
复制代码


完成安装!

[ 本帖最后由 laoniu 于 2006-4-1 13:00 编辑 ]

本帖子中包含更多资源

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

x

评分

1

查看全部评分

 楼主| laoniu 发表于 2006-4-1 12:48:57 | 显示全部楼层
自己占个位置
回复

使用道具 举报

可爱baby 发表于 2006-4-1 12:50:51 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

可爱baby 发表于 2006-4-1 12:51:15 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复

使用道具 举报

 楼主| laoniu 发表于 2006-4-1 12:55:23 | 显示全部楼层
演示图已经上传
回复

使用道具 举报

 楼主| laoniu 发表于 2006-4-1 14:08:37 | 显示全部楼层
没人支持,伤心中
回复

使用道具 举报

泡海椒 发表于 2006-4-1 14:11:02 | 显示全部楼层
我来支持你。。。。。。。。。。。。
回复

使用道具 举报

lmzh89 发表于 2006-4-1 14:11:02 | 显示全部楼层
回复

使用道具 举报

xslxld 发表于 2006-4-1 14:24:51 | 显示全部楼层
嗯.不错
回复

使用道具 举报

linsie 发表于 2006-4-1 14:24:56 | 显示全部楼层
不错.........
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-4 17:37 , Processed in 0.110641 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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