QQ:784742798-力所能及,无偿援助
级别: 一星会员
楼主  发表于: 2008-01-01 14:55

 首页调用(2008.1.10更新):全自适应for6.0

以前版本信息
http://www.phpwind.net/read-htm-tid-551540.html

2008.1.10更新说明:
1、解决小分辨率换行问题
2、

一、本调用特点:
1、全自适应:不管客户端的屏幕分辨率是多少,都能完美整体显示,flash幻灯片也实现了自适应显示;
2、版块显示:实现了不显示“隐藏”、“认证”等版块功能;
3、根据官方home代码,改进了flash调用图片代码,效率更高;
4、更多的使用了“div+css”代码,提高代码执行效率;




二、演示图片如下,由于我的论坛在内部局域网,不方便给大家演示,因此我将选择最新安装成功的论坛地址作为演示地址,希望大家赶快试用哦;非本站演示地址:






三、安装方法:
1、找到“template”目录里的相应风格目录,打开index,htm,找到1-2行代码




复制代码
  1. <!--<?php print <<<EOT
  2. -->





替换为:




复制代码
  1. <!--<?php
  2. //幻灯图开始
  3. $config['time']=10;//10天内的图片主题
  4. $sql = $config['time']>0 ? " AND t.postdate>".($timestamp-86400*$config['time']) : '';
  5. $query = $db->query("SELECT t.tid,t.subject,tm.aid FROM pw_threads t LEFT JOIN $pw_tmsgs tm ON t.tid=tm.tid LEFT JOIN pw_forums f ON t.fid=f.fid WHERE 1 $sql and t.ifupload='1' AND tm.aid!='' AND f.f_type<>'hidden' ORDER BY t.postdate desc LIMIT 5");
  6. while($rt = $db->fetch_array($query)){
  7.     $aid = unserialize($rt['aid']);
  8.     foreach($aid as $key=>$value){
  9.     if($value['type']=='img'){
  10.         $value['attachurl'] = geturl($value['attachurl'],'lf');
  11.         $pics  .= $extra.$value['attachurl'][0];
  12.         $links  .= $extra."read.php?tid=$rt[tid]";
  13.         $texts .= $extra.$rt['subject'];
  14.         $extra = '|';break;
  15.         }
  16.     }
  17. }
  18. //幻灯图结束
  19. //排行开始
  20. $thselect="pt.tid,pt.fid,pt.author,pt.subject,pt.postdate,pt.replies,pt.lastpost,pt.lastposter,pt.hits,pt.digest,pt.dig,pt.ifmark FROM pw_threads pt LEFT JOIN pw_forums pf USING(fid) where pf.f_type <> 'hidden'";
  21. $listnum=10;//显示个数
  22. $listlength=40;//标题长度
  23. $cachelist=R_P."data/bbscache/index_toplist123.php";//主题排行缓存文件
  24. $cachelisttime=20;//主题排行缓存时间
  25. //会员排行开始
  26. if(($timestamp-@filemtime($cachelist)>=$cachelisttime)){
  27. $timelv=$hotmember=$monmember=$newthreads=$digestthreads=$hitsthreads=$digthreads=$replythreads=$ifmarkthreads="";
  28. $query = $db->query("SELECT m.uid,m.username,md.onlinetime FROM pw_members m LEFT JOIN pw_memberdata md USING(uid) WHERE md.onlinetime order by md.onlinetime desc limit 0,$listnum");
  29. while($members=$db->fetch_array($query)){
  30. $members[onlinetime]=(int)($members[onlinetime]/3600);
  31. $i=0;
  32. while((5*$i*$i+15*$i)<=$members[onlinetime])
  33. {$i++;
  34. $C=5*$i*$i+15*$i;
  35. $N=$i;
  36. }
  37. $more= $C-$members[onlinetime];
  38. $lv= $N;
  39. $timelv.="<div class=divindex><div class=fr style='margin-top:3px'><img src='$imgpath/lv/{$lv}.gif' alt='在线等级:{$lv} 级\n在线时长:{$members[onlinetime]} 小时\n升级剩余时间:{$more} 小时'></div><a href='profile.php?action=show&uid=$members[uid]'>$members[username]</a></div>";
  40. }
  41. unset($members);
  42. $query=$db->query("SELECT m.uid,m.username,md.todaypost FROM pw_members m LEFT JOIN pw_memberdata md USING(uid) WHERE md.lastpost>'$tdtime' ORDER BY md.todaypost DESC limit 0,$listnum");
  43. while($members=$db->fetch_array($query)){
  44. $hotmember.="<div class=divindex><div class=fr>[$members[todaypost]]</div><a href='profile.php?action=show&uid=$members[uid]'>$members[username]</a></div>";
  45. }
  46. unset($members);
  47. $query=$db->query("SELECT m.uid,m.username,md.monthpost FROM pw_members m LEFT JOIN pw_memberdata md USING(uid) WHERE md.lastpost>'$montime' ORDER BY md.monthpost DESC limit 0,$listnum");
  48. while($members=$db->fetch_array($query)){
  49. $monmember.="<div class=divindex><div class=fr>[$members[monthpost]]</div><a href='profile.php?action=show&uid=$members[uid]'>$members[username]</a></div>";
  50. }
  51. unset($members);
  52. //会员排行结束
  53. @include_once(D_P.'data/bbscache/forum_cache.php');
  54. $query = $db->query("SELECT ".$thselect." order by pt.postdate desc limit 0,$listnum");
  55. while($threads=$db->fetch_array($query)){
  56. $threads[forum]=substrs($forum[$threads['fid']]['name']);
  57. $threads[lastpost]=get_date($threads[lastpost]);
  58. $threads[subjects]=substrs($threads[subject]);
  59. $threads[subject]=substrs($threads[subject],$listlength);
  60. $newthreads.="<div class=divindex><span class=fr style='text-align:left'>【$threads[author]】</span>[<a href='thread.php?fid=$threads[fid]'><b>$threads[forum]</b></a>]<a href='read.php?tid=$threads[tid]' title='标  题:$threads[subjects]\n作  者:$threads[author]\n回  复:$threads[replies]\n点  击:$threads[hits]\n回复时间:$threads[lastpost]\n最后回复:$threads[lastposter]'>$threads[subject]</a></div>";
  61. }
  62. unset($threads);
  63. $query = $db->query("SELECT ".$thselect." and pt.digest > 0 order by pt.postdate desc limit 0,$listnum");
  64. while($threads=$db->fetch_array($query)){
  65. $threads[forum]=substrs($forum[$threads['fid']]['name']);
  66. $threads[lastpost]=get_date($threads[lastpost]);
  67. $threads[subjects]=substrs($threads[subject]);
  68. $threads[subject]=substrs($threads[subject],$listlength);
  69. $digestthreads.="<div class=divindex><span class=fr style='text-align:left'>【$threads[author]】</span>[<a href='thread.php?fid=$threads[fid]'><b>$threads[forum]</b></a>]<a href='read.php?tid=$threads[tid]' title='标  题:$threads[subjects]\n作  者:$threads[author]\n回  复:$threads[replies]\n点  击:$threads[hits]\n回复时间:$threads[lastpost]\n最后回复:$threads[lastposter]'>$threads[subject]</a></div>";
  70. }
  71. unset($threads);
  72. $query = $db->query("SELECT ".$thselect." and pt.hits > 200 and pt.replies > 10 order by pt.lastpost desc limit 0,$listnum");
  73. while($threads=$db->fetch_array($query)){
  74. $threads[forum]=substrs($forum[$threads['fid']]['name']);
  75. $threads[lastpost]=get_date($threads[lastpost]);
  76. $threads[subjects]=substrs($threads[subject]);
  77. $threads[subject]=substrs($threads[subject],$listlength);
  78. $hitsthreads.="<div class=divindex><span class=fr style='text-align:left'>【$threads[author]】</span>[<a href='thread.php?fid=$threads[fid]'><b>$threads[forum]</b></a>]<a href='read.php?tid=$threads[tid]' title='标  题:$threads[subjects]\n作  者:$threads[author]\n回  复:$threads[replies]\n点  击:$threads[hits]\n回复时间:$threads[lastpost]\n最后回复:$threads[lastposter]'>$threads[subject]</a></div>";
  79. }
  80. unset($threads);
  81. $query = $db->query("SELECT ".$thselect." and pt.dig > 0 order by pt.postdate desc limit 0,$listnum");
  82. while($threads=$db->fetch_array($query)){
  83. $threads[forum]=substrs($forum[$threads['fid']]['name']);
  84. $threads[lastpost]=get_date($threads[lastpost]);
  85. $threads[subjects]=substrs($threads[subject]);
  86. $threads[subject]=substrs($threads[subject],$listlength);
  87. $digthreads.="<div class=divindex><span class=fr style='text-align:left'>【$threads[author]】</span>[<a href='thread.php?fid=$threads[fid]'><b>$threads[forum]</b></a>]<a href='read.php?tid=$threads[tid]' title='标  题:$threads[subjects]\n作  者:$threads[author]\n回  复:$threads[replies]\n点  击:$threads[hits]\n回复时间:$threads[lastpost]\n最后回复:$threads[lastposter]'>$threads[subject]</a></div>";
  88. }
  89. unset($threads);
  90. $query = $db->query("SELECT ".$thselect." and pt.replies > 0 order by pt.lastpost desc limit 0,$listnum");
  91. while($threads=$db->fetch_array($query)){
  92. $threads[forum]=substrs($forum[$threads['fid']]['name']);
  93. $threads[lastpost]=get_date($threads[lastpost]);
  94. $threads[subjects]=substrs($threads[subject]);
  95. $threads[subject]=substrs($threads[subject],$listlength);
  96. $replythreads.="<div class=divindex><span class=fr style='text-align:left'>【$threads[author]】</span>[<a href='thread.php?fid=$threads[fid]'><b>$threads[forum]</b></a>]<a href='read.php?tid=$threads[tid]' title='标  题:$threads[subjects]\n作  者:$threads[author]\n回  复:$threads[replies]\n点  击:$threads[hits]\n回复时间:$threads[lastpost]\n最后回复:$threads[lastposter]'>$threads[subject]</a></div>";
  97. }
  98. unset($threads);
  99. $query = $db->query("SELECT ".$thselect." and pt.ifmark > 0 order by pt.postdate desc limit 0,$listnum");
  100. while($threads=$db->fetch_array($query)){
  101. $threads[forum]=substrs($forum[$threads['fid']]['name']);
  102. $threads[lastpost]=get_date($threads[lastpost]);
  103. $threads[subjects]=substrs($threads[subject]);
  104. $threads[subject]=substrs($threads[subject],$listlength);
  105. $ifmarkthreads.="<div class=divindex><span class=fr style='text-align:left'>【$threads[author]】</span>[<a href='thread.php?fid=$threads[fid]'><b>$threads[forum]</b></a>]<a href='read.php?tid=$threads[tid]' title='标  题:$threads[subjects]\n作  者:$threads[author]\n回  复:$threads[replies]\n点  击:$threads[hits]\n回复时间:$threads[lastpost]\n最后回复:$threads[lastposter]'>$threads[subject]</a></div>";
  106. }
  107. unset($threads);
  108. @writeover($cachelist,"<?php\n\$hitsthreads=\"$hitsthreads\";\n\$ifmarkthreads=\"$ifmarkthreads\";\n\$monmember=\"$monmember\";\n\$hotmember=\"$hotmember\";\n\$timelv=\"$timelv\";\n\$newthreads=\"$newthreads\";\n\$digestthreads=\"$digestthreads\";\n\$replythreads=\"$replythreads\";\n\$digthreads=\"$digthreads\";\n?>");
  109. }
  110. @require_once($cachelist); 
  111. print <<<EOT
  112. -->






2、找到以下代码




复制代码
  1. <!--
  2. EOT;
  3. }foreach($catedb as $k=>$cate){
  4. if($forumdb[$cate[fid]]){
  5. if($cate[across]){print <<<EOT
  6. -->





在其上面添加以下代码:




复制代码
  1. <!--
  2. EOT;
  3. }print <<<EOT
  4. -->
  5. <!--css-->
  6. <style type="text/css">
  7. .li1{FONT-WEIGHT: bold; FONT-SIZE: 12px;text-align:center;background: url('$imgpath/hot/54_Label_1a_1.gif');height:24px}
  8. .li11{text-align:center;background: url('$imgpath/hot/54_Label_1b_1.gif');height:24px}
  9. #listnb{margin:0;padding:0;float:left;height:240px;}
  10. #tpbg{margin:0;padding:0;height:24px;line-height:24px;background-image: url('$imgpath/hot/ttbg.gif');text-align:center;}
  11. #ctbg{margin:0;padding:0;height:240;background-image: url('$imgpath/hot/listbg.gif');line-height:24px;overflow:hidden;}
  12. .divindex{overflow:hidden;height:24px}
  13. </style>
  14. <!--css-->
  15. <div class="t">
  16. <script language="JavaScript" src="js/tx1.js"></script>
  17. <table border="0" cellpadding="0" style="border-collapse: collapse" width="100%">
  18.     <tr>
  19.         <td width="28%" id="tpbg">====最新图片====</td>
  20.         <td class="li1" id="lin1" onmouseover="ShowA('1')" title="最新发表的主题-以发贴时间为准">最新主题</td>
  21.         <td class="li11" id="lin2" onmouseover="ShowA('2')" title="最新回复的主题-以回复时间为准">最新回复</td>
  22.         <td class="li11" id="lin3" onmouseover="ShowA('3')" title="最新精华主题-精华帖子">精华推荐</td>
  23.         <td class="li11" id="lin4" onmouseover="ShowA('4')" title="最新评分主题-评分帖子">评分推荐</td>
  24.         <td class="li11" id="lin5" onmouseover="ShowA('5')" title="会员推荐主题-会员通过帖子里的推荐功能推荐的帖子,目前设置为1">会员推荐</td>
  25.         <td class="li11" id="lin6" onmouseover="ShowA('6')" title="近期热点主题-回复10以上,点击200以上的帖子">近期热点</td>
  26.         <td class="li1" id="linn1" onmouseover="Showb('1')" title="本日会员发贴排行">本日排行</td>
  27.         <td class="li11" id="linn2" onmouseover="Showb('2')" title="本月会员发贴排行">本月排行</td>
  28.         <td class="li11" id="linn3" onmouseover="Showb('3')" title="会员在线时间排行">在线排行</td>
  29.     </tr>
  30.     <tbody>
  31.     <tr>
  32.         <td width="28%">
  33.               <script language="javascript">
  34.             var swf_width="100%"
  35.             var swf_height=240
  36.             var config='5|0xFFFFFF|0x0099ff|50|0xffffff|0x0099ff|0x000000'
  37.             // config 设置分别为: 自动播放时间(秒)|文字颜色|文字背景色|文字背景透明度|按键数字色|当前按键色|普通按键色
  38.             var files='$pics'
  39.             var links='$links'
  40.             var texts='$texts'
  41.             document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="[url]http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6[/url],0,0,0" width="'+ swf_width +'" height="'+ swf_height +'">');
  42.             document.write('<param name="movie" value="{$imgpath}/focus.swf" />');
  43.             document.write('<param name="quality" value="high" />');
  44.             document.write('<param name="menu" value="false" />');
  45.             document.write('<param name=wmode value="opaque" />');
  46.             document.write('<param name="FlashVars" value="config='+config+'&bcastr_flie='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'" />');
  47.             document.write('<embed src="{$imgpath}/focus.swf" wmode="opaque" FlashVars="config='+config+'&bcastr_flie='+files+'&bcastr_link='+links+'&bcastr_title='+texts+'& menu="false" quality="high" width="'+ swf_width +'" height="'+ swf_height +'" type="application/x-shockwave-flash" pluginspage="[url]http://www.macromedia.com/go/getflashplayer"[/url] />');
  48.             document.write('</object>');
  49.       </script>
  50.         </td>
  51.         <td colspan="6" width="48%">
  52.         <div id="ctbg">
  53.             <img src="$imgpath/hot/bbs_inbg43.gif" style="float:left">
  54.             <div id="A1">$newthreads</div>
  55.             <div id="A2" style="DISPLAY: none">$replythreads</div>
  56.             <div id="A3" style="DISPLAY: none">$digestthreads</div>
  57.             <div id="A4" style="DISPLAY: none">$ifmarkthreads</div>
  58.             <div id="A5" style="DISPLAY: none">$digthreads</div>
  59.             <div id="A6" style="DISPLAY: none">$hitsthreads</div>
  60.         </div>
  61.         </td>
  62.         <td colspan="3" width="24%">
  63.         <div id="ctbg">
  64.             <img src="$imgpath/hot/bbs_inbg43.gif" style="float:left">
  65.             <div id="b1">$hotmember</div>
  66.             <div id="b2" style="DISPLAY: none">$monmember</div>
  67.             <div id="b3" style="DISPLAY: none">$timelv</div>
  68.         </div>
  69.         </td>
  70.        
  71.     </tr>
  72.     </tbody>
  73. </table>
  74. </div>






3、将附件里解压的文件夹覆盖到论坛根目录,就安装完毕,进入你修改的风格,查看效果吧;注意你的图片目录可能是images目录也可能是image目录,如果不能显示图片的话,请换到另外一个目录试试;




特别说明:根据目前6.0风格特点,template文件夹只有默认的“wind”风格,如果你只想在某个特定那个风格里使用本帖的调用,你可以在template文件建一个以该风格命名的文件夹如“blue”,然后把wind风格目录里的index.htm文件复制到这个目录里,然后修改即可;




4、欢迎使用本插件,有什么问题可以及时反馈;




5、请有分的给加个分,没分的给捧个场,吧帖子顶起来,谢谢大家
[ 此贴被czjlcl123在2008-01-10 18:38重新编辑 ]
附件: 首页调用(2008.1.10).rar (55 K) 下载次数:1619
附件: 无flash调用 首页调用(2008.1.10).rar (42 K) 下载次数:548
本帖最近评分记录:
  • 威望:+1(xmyjm) 谢谢,不知能否用在6.32上
  • 威望:+5(木逸) 感谢分享
  • 威望:+3(xscac)
  • 威望:+1(laoli99) 优秀文章-欢迎进行技术交 ..
  • 威望:+3(hzbllsx) ...............
  • 威望:+3(楓) 图片没调用
  • 威望:+3(风上人) 很好很强大。。支持
  • http://bbs.yyx8.cn
    级别: 四星会员
    1楼  发表于: 2008-01-01 14:57
    沙发
    级别: 四星会员
    2楼  发表于: 2008-01-01 15:11
     
    级别: 二星会员
    3楼  发表于: 2008-01-01 15:18
    占位
    宁教我负天下人,休教天下人负我
    级别: 六星会员
    4楼  发表于: 2008-01-01 15:20
    我也来个~~~
    急招论坛友情链接  百度.谷歌收录正常就可以
    我的:bbs.5y44.com
    联系QQ:81334548
    http://bbs.tekuu.com
    级别: 新手上路
    5楼  发表于: 2008-01-01 15:21
    不错,我来试试
    http://bbs.yyx8.cn
    级别: 四星会员
    6楼  发表于: 2008-01-01 15:24
    好象什么都点不了?
    QQ:784742798-力所能及,无偿援助
    级别: 一星会员
    7楼  发表于: 2008-01-01 15:29
    Quote:
    引用第6楼scream于2008-01-01 15:24发表的  :
    好象什么都点不了?


    你需要把附件里js目录里的tx1.js文件上传到你论坛根目录js文件夹里,我看了,你论坛的js目录里没有那个文件
    低调的生活着..
    级别: 二星会员
    8楼  发表于: 2008-01-01 15:35
    下来试试
    级别: 新手上路
    9楼  发表于: 2008-01-01 15:39
    元旦最新修改插件..一定要支持了..
    我 谁都不认识 我
    级别: 二星会员
    10楼  发表于: 2008-01-01 15:39
    正好在 试试
    www.ludengxia.cn
    级别: 一星会员
    11楼  发表于: 2008-01-01 15:39
       
    级别: 新手上路
    12楼  发表于: 2008-01-01 15:47