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

 找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索

[插件] Dz首页5格3叠免升级数据缓存版 For Dz5.0 [全DIV+CSS版] [11.12]更新

[复制链接]
Flash菲 发表于 2006-11-5 15:34:53 | 显示全部楼层 |阅读模式
**********************************************************************************
||插件名称: Dz首页5格3叠dingo免升级数据缓存版 [全DIV+CSS] [加入魔MAN的左日发帖缓存版]
||适用版本: Discuz 5.0 SC GBK版本 (目前UFT-8不适用,出现乱码)
||引用代码: Discuz! by wxyuan90 [查询调用主题AND缓存]
||引用代码: Discuz! by 折翼の天使♂ [性别调用]
||作者:  Flash菲 Rockoy
||数据升级: 没有
||最后更新: 2006-10-24
||演示论坛:http://www.fffcn.com/bbs/index.php
||插件安装: 相当容易
||修改文件: templates/default/目录下 css.htm,discuz.htm ,根目录下 index.php
||增加文件: templates/default/目录下 diszuz_toplist.htm toplist_cache.php
||功能说明: 显示最新发布帖子,显示论坛热门话题,显示论坛精华帖子,显示最新回复帖子,整用左侧个人档和右侧资料档
||注意事项:修改文件时请注意备份文件,以免造成不必要的损失
**********************************************************************************
[火狐下正常了.附件已经更新.注意以前用过的需要卸载重装.因为CSS我重写了一遍(那个累吖)]

*NIX 下的主机最好把目录下的所有目录。文件名都改为小写。。。。。。我的失误。。更新附件就不必了。

**********************************************************************************

全新安装开始

1.修改风格目录下的CSS.htm文件最下面加
  1. .topg_buju {
  2.         border: {BORDERWIDTH}px solid {BORDERCOLOR};
  3.         margin:0 auto;
  4.         width : {MAINTABLEWIDTH};
  5.         background: {ALTBG2};
  6.         margin-top : 10px;
  7.         margin-bottom : 10px;
  8. }

  9. .topg_both
  10. {
  11. clear:both;
  12. }
  13. .topg_left
  14. {
  15. float:left;
  16. clear:right;
  17. border: {BORDERWIDTH}px dashed {BORDERCOLOR};
  18. margin-bottom : 1px;
  19. margin-top : 2px;
  20. margin-left : 2px;
  21. margin-right : 2px;
  22. width:37%;
  23. background: {ALTBG1};
  24. }
  25. .topg_center
  26. {
  27. float:left;
  28. clear:right;
  29.         border: {BORDERWIDTH}px dashed {BORDERCOLOR};
  30. margin-bottom : 1px;
  31. margin-top : 2px;
  32. margin-left : 2px;
  33. margin-right : 2px;
  34. width:37%;
  35. background: {ALTBG1};
  36. }
  37. .topg_right
  38. {

  39. float:left;
  40. clear:right;
  41. width:24%;
  42. border: {BORDERWIDTH}px dashed {BORDERCOLOR};
  43. margin-left : 2px;
  44. margin-right : 2px;
  45. border-width : 1px;
  46. margin-top : 2px;
  47. margin-bottom : 1px;
  48. background: {ALTBG1};
  49. }

  50. .topg_header {
  51.         font: {FONTSIZE} {SMFONT} !important;
  52.         font-weight: {BOLD} !important;
  53.         font: {SMFONTSIZE} {SMFONT};
  54.         font-weight: {BOLD};
  55.         color: {HEADERTEXT};
  56.         {HEADERBGCODE};
  57.         height: 25px;
  58.         padding-left: 10px;
  59.         margin-left : 1px;
  60.         margin-right : 1px;
  61.     text-align: left;
  62.         line-height: 25px;
  63.         vertical-align : middle;
  64.         margin-bottom : 1px;
  65.         margin-top : 1px;
  66.         border: {BORDERWIDTH}px solid {BORDERCOLOR};
  67. }

  68. .topg_header_center
  69. {
  70. float:left;
  71. clear:right;
  72.         font: {FONTSIZE} {SMFONT} !important;
  73.         font-weight: {BOLD} !important;
  74.         font: {SMFONTSIZE} {SMFONT};
  75.         font-weight: {BOLD};
  76.         color: {HEADERTEXT};
  77.         {HEADERBGCODE};
  78.         width:31%;
  79.         height: 25px;
  80.         margin-left : 2px;
  81.         margin-right : 2px;
  82.         margin-top : 2px;
  83.     text-align: center;
  84.         vertical-align : middle;
  85.         line-height: 25px;
  86.         border: {BORDERWIDTH}px solid {BORDERCOLOR};
  87. }

  88. .ntopb {
  89. float:left;
  90. clear:right;
  91.         font: {FONTSIZE} {SMFONT} !important;
  92.         font-weight: {BOLD} !important;
  93.         font: {SMFONTSIZE} {SMFONT};
  94.         font-weight: {BOLD};
  95.         border: {BORDERWIDTH}px solid {BORDERCOLOR};
  96.         height: 25px;
  97.         width:31%;
  98.         margin-left : 2px;
  99.         margin-right : 2px;
  100.         margin-top : 2px;
  101.     text-align: center;
  102.         vertical-align : middle;
  103.         line-height: 25px;

  104. }

  105. .topg_footer
  106. {
  107. float:left;
  108. clear:right;
  109. width:75%;
  110. background: {ALTBG1};
  111. text-align: left;
  112. margin-bottom : 3px;

  113. }


  114. .topg_footer_down
  115. {
  116. float:left;
  117. clear:right;
  118. width:23%;
  119. background: {ALTBG1};
  120. text-align: left;
  121. margin-bottom : 3px;
  122. }

  123. .topg_footer_down1
  124. {
  125. float:left;
  126. clear:right;
  127. width:2%;
  128. background: {ALTBG1};
  129. }

  130. .topg_right_footer
  131. {
  132. width: 98%;
  133. clear:both;
  134. border: {BORDERWIDTH}px solid {BORDERCOLOR};
  135. letter-spacing : 3px;
  136. font-size : 12px;
  137. height: 22px;
  138. margin-bottom : 2px;
  139. margin-top : 2px;
  140. margin-left : 2px;
  141. margin-right : 2px;
  142. text-align: left;
  143. vertical-align : middle;
  144.     line-height: 22px;
  145. }
复制代码

2.修改风格目录下discuz.htm文件.删除以下代码
  1. <div style="width: {TABLEWIDTH}; clear: both; overflow: hidden;">

  2. <div class="left" style="line-height: 18px;">
  3. <span class="bold"><!--{if $gid || !$discuz_uid}--><a href="$indexname">$bbname</a><!--{else}-->$discuz_user<!--{/if}-->
  4. <!--{if $supe_status && $discuz_uid}-->
  5. -
  6.         <!--{if !$xspacestatus}-->
  7.                 <a href="$supe_siteurl/index.php?action/register" target="_blank">{lang supe_signin_xspace}</a>
  8.         <!--{else}-->
  9.                 <a href="$supe_siteurl/index.php?action/space/uid/$discuz_uid" target="_blank">{lang supe_myxspace}</a>
  10.         <!--{/if}-->
  11. <!--{/if}-->
  12. </span>
  13. <br>
  14. {lang credits}: <span class="bold smalltxt">$credits</span> <span id="creditlist">{lang credits_detail}<script type="text/javascript">menuregister(false, "creditlist", true)</script></span> / {lang index_status}:
  15. <!--{if $validdays}-->
  16.         <a href="member.php?action=groupexpiry"><span class="bold">$grouptitle</span>($validdays)</a>
  17. <!--{else}-->
  18.         <span class="bold">$grouptitle</span><!--{/if}-->
  19. <!--{if $allowinvisible && $discuz_uid}-->{lang online_status}:
  20.         <!--{if !empty($invisible)}-->
  21.                 <a href="member.php?action=switchstatus" title="{lang login_switch_normal_mode}">{lang login_invisible_mode}</a>
  22.         <!--{else}-->
  23.                 <a href="member.php?action=switchstatus" title="{lang login_switch_invisible_mode}">{lang login_normal_mode}</a>
  24.         <!--{/if}-->
  25. <!--{/if}--><br>
  26. {lang your_lastvisit} <span class="smalltxt">$lastvisittime</span><br>
  27. </div>

  28. <div class="right" style="line-height: 18px;">
  29. <a href="search.php?srchfrom=$newthreads&searchsubmit=yes">{lang show_newthreads}</a> |
  30. <!--{if $discuz_uid}-->
  31.         <!--{if $allowuseblog}-->
  32.                 <a href="blog.php?uid=$discuz_uid" target="_blank">{lang blog}</a> |
  33.         <!--{/if}-->
  34. <!--{/if}-->
  35. <a href="digest.php">{lang digest}</a> |
  36. <a href="member.php?action=markread">{lang mark_read}</a>
  37. <!--{if $rssstatus}--><a href="rss.php?auth=$rssauth" target="_blank"><img src="images/common/xml.gif" border="0" class="absmiddle" alt="{lang rss_subscribe_all}" /></a> <a href="#bottom"><img src="{IMGDIR}/arrow_dw.gif" border="0" class="absmiddle" alt="" /></a><!--{/if}-->
  38. <br>
  39. {lang total} <span class="smalltxt">$threads</span> {lang index_threads} / <span class="smalltxt">$posts</span> {lang index_posts} / {lang index_today} <span class="smalltxt">$todayposts</span> {lang index_posts}<br>
  40. {lang total} <span class="smalltxt">$totalmembers</span> {lang index_members} / {lang welcome_newmember} <a href="viewpro.php?username=$memberenc"><span class="bold">$lastmember</span></a>
  41. </div>

  42. </div>
复制代码
在找
  1. <!--{loop $catlist $key $cat}-->
  2.         <!--{if $cat['forumscount']}-->
复制代码
上面加
  1. {template dz_toplist}
复制代码

3.修改根目录下index.php文件找到
  1. require_once './include/common.inc.php';
复制代码
在下面加
  1. require_once DISCUZ_ROOT.'./include/toplist_cache.php';
复制代码

4.按附件格式上传文件

5.更新CSS缓存



so  我自己都发现了一些问题。。主要是多余代码蛮多。。然后在IE7下很惨。。。so  打算重做。。

[ 本帖最后由 Flash菲 于 2007-1-20 13:00 编辑 ]
 楼主| Flash菲 发表于 2006-11-5 15:35:10 | 显示全部楼层
BS 9楼的。根本没做修改就说修改成功。。纯AD!!


FLASH幻灯片其实很简单。。可以自己修改。我弄的不是调用论坛图片附件。只是自己加个FLASH而已。。

PS:

强烈要求使用不成功的检查CSS缓存是否有问题


附件全部更新[效果和我站完全一样!]。请用这个的多看看images/ad/bbsplayer.js这个文件。


昨天到唱K。。。HOME页又延迟了。汗了。。。

缓存优点:
多数时间不需要查询数据库,直接从缓存文件中调用数据,速度飞快
缓存缺点:
缓存文件需要更新,编写不恰当可能造成数据滞后
由于缓存文件需要建立,所以可能首次(仅仅一次)访问会出现空白

默认是5分钟自动更新一次缓存
另外推荐参考
https://discuz.dismall.com/thread-447634-1-1.html
做一下发贴/回帖自动更新,这样基本上感觉不到数据有滞后,不做的话会有一个缺点就是回复主题/发表主题以后首页内容不会立刻更新而是要等到设置的更新时间(5分钟)才会更新

[ 本帖最后由 Flash菲 于 2006-11-12 10:45 编辑 ]
回复

使用道具 举报

wxyuan90 发表于 2006-11-5 15:38:51 | 显示全部楼层
踩!
位置位置

=========================
回帖、发贴后自动更新缓存
参考https://discuz.dismall.com/thread-447634-1-1.html

=========================
目前DZ所有首页N格当中不修改cache.inc.php就实现真正缓存的独此一家。

其他首页N格可以参考上面那个链接改成缓存的

实际测试(使用5格3叠1024版本+DZ5)
使用缓存前首页
Processed in 0.135858 second(s), 10 queries , Gzip enabled

做了补丁,使用缓存后首页
Processed in 0.024563 second(s), 5 queries , Gzip enabled

[ 本帖最后由 wxyuan90 于 2006-11-5 19:46 编辑 ]
回复

使用道具 举报

无效楼层,该帖已经被删除
安. 发表于 2006-11-5 15:45:58 | 显示全部楼层
回复

使用道具 举报

☆阿满☆ 发表于 2006-11-5 15:48:00 | 显示全部楼层
这个也DIV+CSS?  等等看
回复

使用道具 举报

 楼主| Flash菲 发表于 2006-11-5 15:56:19 | 显示全部楼层
大家支持下哈。。

我弄FLASH幻灯版去了
回复

使用道具 举报

wxyuan90 发表于 2006-11-5 15:56:21 | 显示全部楼层
新增文件toplist.php是在include下面的

注意!楼下的并不是缓存版本的演示

[ 本帖最后由 wxyuan90 于 2006-11-5 16:09 编辑 ]
回复

使用道具 举报

phpww 发表于 2006-11-5 15:56:40 | 显示全部楼层
我已修改成功,AD一下:http://bbs.ttwv.com
回复

使用道具 举报

 楼主| Flash菲 发表于 2006-11-5 15:57:27 | 显示全部楼层

回复 #8 wxyuan90 的帖子

你看看附件格式嘛。。

奸笑中
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-23 18:32 , Processed in 0.165819 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

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